Пример #1
0
 private void button7_Click(object sender, EventArgs e)
 {
     if (Application.OpenForms["Form10"] == null)
     {
         Form10 f10 = new Form10();
         f10.Show();
     }
 }
Пример #2
0
        private void button8_Click(object sender, EventArgs e)
        {
            DialogResult onayla;

            onayla = MessageBox.Show("Oturumu Kapatmak İstediğinizden Emin Misiniz?", "Çıkış", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
            if (onayla == DialogResult.Yes)
            {
                Form1 f1 = new Form1();
                Program.con.MainForm = f1;
                f1.Show();
                this.Close();
                if (Application.OpenForms["Form4"] != null)
                {
                    Form4 f4 = (Form4)Application.OpenForms["Form4"];
                    f4.Close();
                }
                if (Application.OpenForms["Form5"] != null)
                {
                    Form5 f5 = (Form5)Application.OpenForms["Form5"];
                    f5.Close();
                }
                if (Application.OpenForms["Form6"] != null)
                {
                    Form6 f6 = (Form6)Application.OpenForms["Form6"];
                    f6.Close();
                }
                if (Application.OpenForms["Form7"] != null)
                {
                    Form7 f7 = (Form7)Application.OpenForms["Form7"];
                    f7.Close();
                }
                if (Application.OpenForms["Form8"] != null)
                {
                    Form8 f8 = (Form8)Application.OpenForms["Form8"];
                    f8.Close();
                }
                if (Application.OpenForms["Form9"] != null)
                {
                    Form9 f9 = (Form9)Application.OpenForms["Form9"];
                    f9.Close();
                }
                if (Application.OpenForms["Form10"] != null)
                {
                    Form10 f10 = (Form10)Application.OpenForms["Form10"];
                    f10.Close();
                }
            }
        }