private void barButton_License_ItemClick(object sender, ItemClickEventArgs e) { try { if (FormCompanyLicense != null) { FormCompanyLicense.Visible = true; FormCompanyLicense.Activate(); } else { FormCompanyLicense = new CompanyLicense_Form(); FormCompanyLicense.Closed += FormCompanyLicense_Closed; AddOwnedForm(FormCompanyLicense); FormCompanyLicense.MdiParent = this; FormCompanyLicense.Show(); } } catch (Exception ex) { LogError.WriteLogError("ShowFormMain", ex); MessageBox.Show("Lỗi show form"); } }
private void FormCompanyLicense_Closed(object sender, EventArgs e) { FormCompanyLicense.Dispose(); FormCompanyLicense = null; }