private void button8_Click(object sender, EventArgs e) { if (!MainDashboard.DailyJobSheetFormOpen) { frmLoading.ShowLoadingScreen(); frmProductionRecordNew frm = new frmProductionRecordNew { MdiParent = this.ParentForm, StartPosition = FormStartPosition.CenterScreen, WindowState = FormWindowState.Maximized }; frm.Show(); MainDashboard.DailyJobSheetFormOpen = true; frmLoading.CloseForm(); } else { if (Application.OpenForms.OfType <frmProductionRecordNew>().Count() == 1) { Application.OpenForms.OfType <frmProductionRecordNew>().First().BringToFront(); } } }
private void dAILYToolStripMenuItem_Click(object sender, EventArgs e) { if (true) { if (!DailyJobSheetFormOpen) { frmLoading.ShowLoadingScreen(); frmProductionRecordNew frm = new frmProductionRecordNew(); frm.MdiParent = this; frm.StartPosition = FormStartPosition.CenterScreen; frm.WindowState = FormWindowState.Maximized; frm.Show(); DailyJobSheetFormOpen = true; frmLoading.CloseForm(); } else { if (Application.OpenForms.OfType <frmProductionRecordNew>().Count() == 1) { Application.OpenForms.OfType <frmProductionRecordNew>().First().BringToFront(); } } } }