private void tsPatientRoom_Click(object sender, EventArgs e) { if (room == null) { room = new frmPatientRoom(); room.MdiParent = this; room.FormClosed += new FormClosedEventHandler(room_FormClosed); room.Show(); } else { room.Activate(); room.WindowState = FormWindowState.Normal; } }
void room_FormClosed(object sender, FormClosedEventArgs e) { room = null; }