コード例 #1
0
ファイル: Form1.cs プロジェクト: marcagas/Migatsu-Inventory
        private void colorToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                AddNewColor ARF = null;

                if (IsFormAlreadyOpen(typeof(AddNewColor)) == null)
                {
                    ARF           = new AddNewColor();
                    ARF.MdiParent = this;
                    ARF.Show();
                }
                else
                {
                    Form selectedForm = IsFormAlreadyOpen(typeof(AddNewColor));
                    foreach (Form OpenForm in this.MdiChildren)
                    {
                        if (OpenForm == selectedForm)
                        {
                            if (selectedForm.WindowState == FormWindowState.Minimized)
                            {
                                selectedForm.WindowState = FormWindowState.Normal;
                            }
                            selectedForm.Select();
                        }
                    }
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.GetBaseException().ToString());
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: marcagas/Migatsu-Inventory
        private void colorToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                AddNewColor ARF = null;

                if (IsFormAlreadyOpen(typeof(AddNewColor)) == null)
                {
                    ARF = new AddNewColor();
                    ARF.MdiParent = this;
                    ARF.Show();
                }
                else
                {
                    Form selectedForm = IsFormAlreadyOpen(typeof(AddNewColor));
                    foreach (Form OpenForm in this.MdiChildren)
                    {
                        if (OpenForm == selectedForm)
                        {
                            if (selectedForm.WindowState == FormWindowState.Minimized)
                            {
                                selectedForm.WindowState = FormWindowState.Normal;
                            }
                            selectedForm.Select();
                        }
                    }
                }
            }
            catch (Exception x)
            {
                MessageBox.Show(x.GetBaseException().ToString());
            }
        }