Пример #1
0
        private void adjustmentsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            try
            {
                AdjustmentForm ARF = null;

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

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