void Application_ThreadException(object sender, ThreadExceptionEventArgs e) { using (var dlg = new ExceptionDialog()) { dlg.Exception = e.Exception; dlg.ShowDialog(this); } }
private void backgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (e.Error != null) { using (var dlg = new ExceptionDialog()) { dlg.Exception = e.Error; dlg.ShowDialog(this); } } Text = AppTitle; runButton.Enabled = true; UseWaitCursor = false; Activate(); }