private void tìmKiếmSinhVậtToolStripMenuItem_Click(object sender, EventArgs e) { foreach (Form form in Application.OpenForms) { if (form.GetType() == typeof(frmTKSVH)) { form.Close(); break; } } if ((Application.OpenForms["frmTKSVH"] as frmTKSVH) == null) { frmTKSVH frmTKSVHmn = new frmTKSVH(); frmTKSVHmn.Show(); } }
private void pictureBox1_Click(object sender, EventArgs e) { foreach (Form form in Application.OpenForms) { if (form.GetType() == typeof(frmTKSVH)) { form.Close(); break; } } if ((Application.OpenForms["frmTKSVH"] as frmTKSVH) == null) { frmTKSVH frmTKSVHmn = new frmTKSVH(); frmTKSVHmn.FormClosed += FrmTKSVHmn_FormClosed; frmTKSVHmn.Show(); } }