private void tsPrecrisptions_Click(object sender, EventArgs e) { if (prescription == null) { prescription = new frmPatientPrescription(); prescription.MdiParent = this; prescription.FormClosed += new FormClosedEventHandler(prescription_FormClosed); prescription.Show(); } else { prescription.Activate(); prescription.WindowState = FormWindowState.Normal; } }
void prescription_FormClosed(object sender, FormClosedEventArgs e) { prescription = null; }