// file menu event handling private void fileToolStripMenuItem_Click(object sender, EventArgs e) { senderItem = (ToolStripMenuItem)sender; if (senderItem.Name == newToolStripMenuItem.Name) // new { childContainer = new ChildForm(); childContainer.MdiParent = this; childContainer.Show(); if (closeToolStripMenuItem.Enabled == false) { closeToolStripMenuItem.Enabled = true; formatToolStripMenuItem.Enabled = true; } } else if (senderItem.Name == closeToolStripMenuItem.Name) // close { if (HasChildren) { ActiveMdiChild.Dispose(); } if (ActiveMdiChild == null) { closeToolStripMenuItem.Enabled = false; formatToolStripMenuItem.Enabled = false; } } else if (senderItem.Name == exitToolStripMenuItem.Name) // exit { Application.Exit(); } }
private void toolStripLogout_Click(object sender, EventArgs e) { if (ActiveMdiChild != null) { foreach (Form form in this.MdiChildren) { ActiveMdiChild.Dispose(); } } ShowAuthenticationView(); }
public void OpenForm(Form form) { if (ActiveMdiChild != null) { ActiveMdiChild.Dispose(); openForm(form); } else { openForm(form); } }
private void allTransactionToolStripMenuItem_Click(object sender, EventArgs e) { if (ActiveMdiChild != null) { ActiveMdiChild.Dispose(); } AllTransactionForm allTransactionForm = new AllTransactionForm(); allTransactionForm.MdiParent = this; allTransactionForm.Show(); allTransactionForm.WindowState = FormWindowState.Minimized; allTransactionForm.WindowState = FormWindowState.Maximized; }
private void expeditionToolStripMenuItem_Click(object sender, EventArgs e) { if (ActiveMdiChild != null) { ActiveMdiChild.Dispose(); } ExpeditionForm expeditionForm = new ExpeditionForm(); expeditionForm.MdiParent = this; expeditionForm.Show(); expeditionForm.WindowState = FormWindowState.Minimized; expeditionForm.WindowState = FormWindowState.Maximized; }
private void shopToolStripMenuItem_Click(object sender, EventArgs e) { if (ActiveMdiChild != null) { ActiveMdiChild.Dispose(); } ShopForm shopForm = new ShopForm(); shopForm.MdiParent = this; shopForm.Show(); shopForm.WindowState = FormWindowState.Minimized; shopForm.WindowState = FormWindowState.Maximized; }
private void detailToolStripMenuItem_Click(object sender, EventArgs e) { if (ActiveMdiChild != null) { ActiveMdiChild.Dispose(); } DetailForm detailForm = new DetailForm(this); detailForm.MdiParent = this; detailForm.Show(); detailForm.WindowState = FormWindowState.Minimized; detailForm.WindowState = FormWindowState.Maximized; }