private void Hospital_Load(object sender, EventArgs e) { try { MdiClient CtlMdi; foreach (Control ctl in this.Controls) { try { string type = ctl.GetType().ToString(); if (type.Equals("System.Windows.Forms.MdiClient")) { CtlMdi = (MdiClient)ctl; CtlMdi.BackColor = System.Drawing.Color.White; } } catch (Exception a) { CommonLogger.Info(a.ToString()); } } if (LoggedUser.id > 0) { SetMenuItems(); lnkChangePwd.Visible = true; tblLoginPanel.Visible = true; } else { lnkChangePwd.Visible = false; tblLoginPanel.Visible = false; } frmDashboard frm = new frmDashboard(); frm.MdiParent = this; frm.Show(); frm.WindowState = FormWindowState.Maximized; } catch (Exception ex) { CommonLogger.Info(ex.ToString()); } }
private void btnDashboard_Click(object sender, EventArgs e) { try { if (Application.OpenForms.OfType <frmDashboard>().Count() == 1) { Application.OpenForms.OfType <frmDashboard>().First().BringToFront(); } else { frmDashboard frm = new frmDashboard(); frm.MdiParent = this; frm.Show(); } } catch (Exception ex) { CommonLogger.Info(ex.ToString()); } }
private void btnDashboard_Click(object sender, EventArgs e) { try { if (Application.OpenForms.OfType <frmDashboard>().Count() == 1) { Application.OpenForms.OfType <frmDashboard>().First().BringToFront(); } else { frmDashboard frm = new frmDashboard(); frm.MdiParent = this; frm.Show(); } // New Implementation - 01-April-2019 // To hide ChildClose button on dashboard load. btnChildClose.Visible = false; } catch (Exception ex) { CommonLogger.Info(ex.ToString()); } }