How to get return value when BeginInvoke/Invoke is called in C#
问题 I've this little method which is supposed to be thread safe. Everything works till i want it to have return value instead of void. How do i get the return value when BeginInvoke is called? public static string readControlText(Control varControl) { if (varControl.InvokeRequired) { varControl.BeginInvoke(new MethodInvoker(() => readControlText(varControl))); } else { string varText = varControl.Text; return varText; } } Edit: I guess having BeginInvoke is not nessecary in this case as i need