private void button8_Click(object sender, EventArgs e) { hideUnwantedForms(); Sales_History sh = Sales_History.getSalesHistory(splitContainer1, this); sh.Location = new Point((splitContainer1.Panel2.Width - sh.Width) / 2, (splitContainer1.Panel2.Height - sh.Height) / 2); sh.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; sh.Show(); }
public static Sales_History getSalesHistory(SplitContainer s, Form f) { if (sh == null || sh.IsDisposed) { sh = new Sales_History(); sh.MdiParent = f; s.Panel2.Controls.Add(sh); return(sh); } else { return(sh); } }