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 BeginI
delegate string StringInvoker();
string GetControlText()
{
if (control.InvokeRequired)
{
string controltext = (string)control.Invoke(new StringInvoker(GetControlText));
return(controltext);
}
else
{
return(control.Text);
}
}
//simple & elegant but it is needed to wait for another thread to execute delegate; however if you cannot proceed without the results...