public void StatusErrorLabel_Click(object sender, EventArgs e) { win = new Forms.ErrorReportWindow(); ControlsHelper.CheckTopMost(win); ControlsHelper.AutoSizeByOpenForms(win); win.Width = Math.Min(1450, SystemParameters.WorkArea.Width - 200); // Suspend displaying cloud queue results, because ShowDialog locks UI updates in the back. Global.DHelper.Stop(); FormEventsEnabled = false; MainBodyPanel.CloudPanel.EnableDataSource(false); win.ErrorReportPanel.SendMessages += win.ErrorReportPanel_SendMessages; win.ErrorReportPanel.ClearErrors += ErrorReportPanel_ClearErrors; Global.CloudClient.TasksTimer.Queue.ListChanged += Queue_ListChanged; var result = win.ShowDialog(); Global.CloudClient.TasksTimer.Queue.ListChanged -= Queue_ListChanged; win.ErrorReportPanel.SendMessages -= win.ErrorReportPanel_SendMessages; win.ErrorReportPanel.ClearErrors -= ErrorReportPanel_ClearErrors; MainBodyPanel.CloudPanel.EnableDataSource(true); if (Global.AllowDHelperStart) { FormEventsEnabled = true; Global.DHelper.Start(); } }