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

                if (IsFormAlreadyOpen(typeof(AddInventory)) == null)
                {
                    ARF           = new AddInventory();
                    ARF.MdiParent = this;
                    ARF.Show();
                }
                else
                {
                    Form selectedForm = IsFormAlreadyOpen(typeof(AddInventory));
                    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
        public void openAnotherForm(object sender, EventArgs e)
        {
            Form1 fm = new Form1();

            try
            {
                AddInventory ARF = null;

                if (IsFormAlreadyOpen(typeof(AddInventory)) == null)
                {
                    ARF           = new AddInventory();
                    ARF.MdiParent = fm;
                    ARF.Show();
                    MessageBox.Show("SUccess");
                }
                else
                {
                    Form selectedForm = IsFormAlreadyOpen(typeof(AddInventory));
                    foreach (Form OpenForm in fm.MdiChildren)
                    {
                        if (OpenForm == selectedForm)
                        {
                            if (selectedForm.WindowState == FormWindowState.Minimized)
                            {
                                selectedForm.WindowState = FormWindowState.Normal;
                            }
                            selectedForm.Select();
                        }
                    }
                }
                return;
            }
            catch (Exception x)
            {
                MessageBox.Show(x.GetBaseException().ToString());
            }
        }
Beispiel #3
0
        private void receiveInventoryToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            try
            {
                AddInventory ARF = null;

                if (IsFormAlreadyOpen(typeof(AddInventory)) == null)
                {
                    ARF = new AddInventory();
                    ARF.MdiParent = this;
                    ARF.Show();
                }
                else
                {
                    Form selectedForm = IsFormAlreadyOpen(typeof(AddInventory));
                    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 #4
0
        public void openAnotherForm(object sender, EventArgs e)
        {
            Form1 fm = new Form1();
            try
            {
                AddInventory ARF = null;

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