Beispiel #1
0
 private void updateBTN_Click(object sender, EventArgs e)
 {
     if (stu == null)
     {
         MessageBox.Show("select Student ");
     }
     else
     {
         bool Isopen = false;
         foreach (Form f in Application.OpenForms)
         {
             if (f.Text == "Student_Reg")
             {
                 Isopen = true;
                 f.BringToFront();
                 break;
             }
         }
         if (Isopen == false)
         {
             Student_Reg stur = new Student_Reg(student, "update");
             stur.Show();
         }
     }
 }
Beispiel #2
0
        private void Student_Click(object sender, EventArgs e)
        {
            Button button = sender as Button;

            if (button.Name.Equals("register_Btn"))
            {
                bool Isopen = false;
                foreach (Form f in Application.OpenForms)
                {
                    if (f.Text == "Student_Reg")
                    {
                        Isopen = true;
                        f.BringToFront();
                        break;
                    }
                }
                if (Isopen == false)
                {
                    Student_Reg sr = new Student_Reg();
                    sr.Show();
                }
            }
        }