コード例 #1
0
ファイル: Form1.cs プロジェクト: cdmccauley/csharp-demos
        // 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();
            }
        }
コード例 #2
0
ファイル: WorkLogUIView.cs プロジェクト: nisha-naeem/WorkLog
 private void toolStripLogout_Click(object sender, EventArgs e)
 {
     if (ActiveMdiChild != null)
     {
         foreach (Form form in this.MdiChildren)
         {
             ActiveMdiChild.Dispose();
         }
     }
     ShowAuthenticationView();
 }
コード例 #3
0
 public void OpenForm(Form form)
 {
     if (ActiveMdiChild != null)
     {
         ActiveMdiChild.Dispose();
         openForm(form);
     }
     else
     {
         openForm(form);
     }
 }
コード例 #4
0
        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;
        }
コード例 #5
0
        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;
        }
コード例 #6
0
        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;
        }
コード例 #7
0
        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;
        }