Beispiel #1
0
        private void subCToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                AddSubCategoryForm ARF = null;

                if (IsFormAlreadyOpen(typeof(AddSubCategoryForm)) == null)
                {
                    ARF           = new AddSubCategoryForm();
                    ARF.MdiParent = this;
                    ARF.Show();
                }
                else
                {
                    Form selectedForm = IsFormAlreadyOpen(typeof(AddSubCategoryForm));
                    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());
            }
        }
Beispiel #2
0
        private void subCToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                AddSubCategoryForm ARF = null;

                if (IsFormAlreadyOpen(typeof(AddSubCategoryForm)) == null)
                {
                    ARF = new AddSubCategoryForm();
                    ARF.MdiParent = this;
                    ARF.Show();
                }
                else
                {
                    Form selectedForm = IsFormAlreadyOpen(typeof(AddSubCategoryForm));
                    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());
            }
        }