The problem is that you're calling MessageBox.Show
from a threadpool thread. You need to call it from the UI thread. To do that, you need to synchronize with the UI thread. For example:
this.Invoke((MethodInvoker) delegate
{ MessageBox.Show("success!"); });
The call to Invoke
will execute the code on the UI thread. See documentation for Control.Invoke for more information.