private void userProfileTSMenuItem_Click(object sender, EventArgs e) { try { frmUserCreate objCreateUser = null; FormCollection frmColl = Application.OpenForms; bool blFrmOpen = false; foreach (Form objfrm in frmColl) { if (objfrm.Name.ToUpper() == "FRMCREATEUSER") { objCreateUser = (frmUserCreate)objfrm; blFrmOpen = true; objCreateUser.Show(); objCreateUser.WindowState = FormWindowState.Maximized; } } if (!blFrmOpen) { objCreateUser = new frmUserCreate(); objCreateUser.MdiParent = this; objCreateUser.Show(); } } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.ToString()); } }
private void createUserToolStripMenuItem_Click(object sender, EventArgs e) { try { if (!General.CheckFormIsOpenedORnot(typeof(frmUserCreate).Name.ToUpper(), _objUserCreate)) { _objUserCreate = new frmUserCreate(); _objUserCreate.WindowState = FormWindowState.Maximized; } _objUserCreate.MdiParent = this; _objUserCreate.Show(pnlMain); } catch (Exception ex) { ErrorHandling.WriteErrorLog(ex.Message); } }