void m_BackgroundWorker_BoxPlotCompleted(object sender, RunWorkerCompletedEventArgs e) { clsPlotResult mclsPlotResult; var mfrmBoxPlotDisplay = new frmBoxPlotDisplay(mclsBoxPlotPar); mfrmShowProgress.Hide(); mfrmShowProgress.DialogResult = DialogResult.Cancel; if (e.Error != null) { MessageBox.Show(e.Error.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } else if (e.Cancelled) { Console.WriteLine("Canceled"); } else { mclsPlotResult = (clsPlotResult)e.Result; mfrmBoxPlotDisplay.Image = mclsPlotResult.mImage; mfrmBoxPlotDisplay.PlotName = mclsPlotResult.mstrPlotName; mfrmBoxPlotDisplay.DAnTEinstance = this; mfrmBoxPlotDisplay.MdiParent = m_frmDAnTE.MdiParent; mfrmBoxPlotDisplay.Title = "Box Plots"; mfrmBoxPlotDisplay.Show(); } }