private void handleThrowException(object sender, ExceptionEventArgs e) { if (InvokeRequired) { Invoke(new Action<object, ExceptionEventArgs>(handleThrowException), sender, e); return; } MessageBox.Show(e.Exception.ToString()); }