in main form, Hide method does not work, but when I use code snippet below for hiding my form, it work.
What's the difference?
BeginInvoke(new MethodInvoker(delegate
{
Hide();
} ) );Why Hide does not work but this method works?Thanks

VulpesPosted Jun 9, 2011, 2:19 PM
In a case such as this, you have to marshal the call to Hide() back to the UI thread which is what your code does. BeginInvoke() does this asynchronously and Invoke() does it synchronously.
VulpesPosted Jun 9, 2011, 2:32 PM
Majid KamaliPosted Jun 9, 2011, 2:26 PM
Why it should be in a different thread ?
FroglegPosted Jun 9, 2011, 2:14 PM
this.Hide();