Пример #1
0
 private void bt_BloodTestDetail_Click(object sender, EventArgs e)
 {
     if ((lb_BloodTestID.Text != string.Empty) && (lb_BloodTestID.Text != null))
     {
         foreach (Form form in Application.OpenForms) //คำสั่งห้ามเปิดซ้อนสอง
         {
             if (form.GetType() == typeof(FrmBloodTest))
             {
                 form.Activate();
                 return;
             }
         }
         FrmBloodTest iFrmBloodTest = new FrmBloodTest();
         iFrmBloodTest.MdiParent = MainForm.ActiveForm;
         iFrmBloodTest.Show();
         iFrmBloodTest.lb_BloodTestID.Text = lb_BloodTestID.Text;
     }
 }
Пример #2
0
        private void bt_BloodTest_Click(object sender, EventArgs e)
        {
            if ((txb_PetProfileID.Text != null) && (txb_PetProfileID.Text != string.Empty))
            {
                foreach (Form form in Application.OpenForms) //คำสั่งห้ามเปิดซ้อนสอง
                {
                    if (form.GetType() == typeof(FrmBloodTest))
                    {
                        form.Activate();
                        return;
                    }
                }

                FrmBloodTest iFrmBloodTest = new FrmBloodTest();
                iFrmBloodTest.MdiParent = MainForm.ActiveForm;
                iFrmBloodTest.Show();
                iFrmBloodTest.lb_PetID.Text = txb_PetProfileID.Text;
                //this.Close();
            }
            else
            {
                MessageBox.Show("กรุณาเลือกสัตว์ไข้", "ไม่พบสัตว์ไข้");
            }
        }