Do I need to invoke MessageBox calls?
- by mafutrct
To pop-up a message box, I'm using MessageBox.Show(...). I usually wrap this call in an Invoke:
BeginInvoke (new Action (() => {
MessageBox.Show ());
}));
I've got 2 questions:
Do I always need to wrap the MessageBox call in an Invoke if I'm calling from a non-GUI thread?
If so, should I use BeginInvoke or Invoke? I found not much difference in my tests, BeginInvoke is, as expected (and unlike Invoke), displayed with a slight delay.