public static frmHomePage GetInstance() { if (frmMainPage == null) { frmMainPage = new frmHomePage(); } return(frmMainPage); }
private void picMenuSub1_Click(object sender, EventArgs e) { frmHomePage childForm = frmHomePage.GetInstance(); childForm.MdiParent = this; childForm.Parent = splitContainer.Panel2; childForm.WindowState = FormWindowState.Normal; childForm.Dock = DockStyle.Fill; childForm.Size = new Size(splitContainer.Width - splitContainer.SplitterDistance, splitContainer.Height); childForm.BringToFront(); childForm.Show(); }
private void SetHomePage() { frmHomePage childForm = frmHomePage.GetInstance(); childForm.MdiParent = this; childForm.Parent = splitContainer.Panel2; childForm.WindowState = FormWindowState.Normal; childForm.Dock = DockStyle.Fill; childForm.Size = new Size(splitContainer.Width - splitContainer.SplitterDistance, splitContainer.Height); childForm.BringToFront(); childForm.Show(); //ShowChildForm<frmHomePage>(); }