private void MainButton_Click(object sender, EventArgs e) { Form f = this.FindForm(); f.Controls.Remove(this); MainScreen ms = new MainScreen(); f.Controls.Add(ms); ms.Location = new Point((f.Width - ms.Width) / 2, (f.Height - ms.Height) / 2); ms.Focus(); }
public void mainScreen() { Form f = this.FindForm(); f.Controls.Remove(this); MainScreen ms = new MainScreen(); f.Controls.Add(ms); ms.Location = new Point((f.Width - ms.Width) / 2, (f.Height - ms.Height) / 2); ms.Focus(); }