private void barButtonItem_ThoiHan_ItemClick(object sender, ItemClickEventArgs e) { if (formThoiHanSuDung == null) { formThoiHanSuDung = new F_Main_ThoiHanSuDung(); formThoiHanSuDung.MdiParent = this; formThoiHanSuDung.FormClosed += new FormClosedEventHandler(formThoiHanSuDung_FormClosed); formThoiHanSuDung.Show(); } else { formThoiHanSuDung.Activate(); } }
void formThoiHanSuDung_FormClosed(object sender, FormClosedEventArgs e) { formThoiHanSuDung = null; }