//returns to the first User Form private void backButton_Click(object sender, EventArgs e) { Form f = this.FindForm(); f.Controls.Remove(this); MainScreen ms = new MainScreen(); f.Controls.Add(ms); }
//returns users to home page private void button1_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((this.Width - ms.Width) / 2, (this.Height - ms.Height) / 2); }
public Form1() { InitializeComponent(); MainScreen ms = new MainScreen(); this.Controls.Add(ms); ms.Location = new Point((this.Width - ms.Width) / 2, (this.Height - ms.Height) / 2); ms.Show(); }