//窗体第一次出现时 private void Cat_Shown(object sender, EventArgs e) { if (welcome == null) { welcome = WelCome.getInstance(); welcome.Show(); } }
public static WelCome getInstance() { if (welcome == null || welcome.IsDisposed) { welcome = new WelCome(); welcome.FormBorderStyle = FormBorderStyle.None; welcome.Dock = DockStyle.Fill; welcome.MdiParent = Cat.ActiveForm; welcome.WindowState = FormWindowState.Maximized; } return(welcome); }
//首页 private void toolStripMenuItem1_Click(object sender, EventArgs e) { Form active = this.ActiveMdiChild; if (active != null) { active.Dispose(); } if (welcome == null || welcome.IsDisposed) { welcome = WelCome.getInstance(); welcome.Show(); } }