private void Form1_Load_1(object sender, EventArgs e) { MainScreen ms = new MainScreen(); this.Controls.Add(ms);//opening the main screen usercontrol ms.Location = new Point((this.Width - ms.Width) / 2, (this.Height - ms.Height) / 2); ms.Focus(); Cursor.Hide(); }
private void playButton_Click(object sender, EventArgs e) { Form f = this.FindForm(); f.Controls.Remove(this); MainScreen ms = new MainScreen(); ms.Location = new Point((f.Width - ms.Width) / 2, (f.Height - ms.Height) / 2); f.Controls.Add(ms); Form1.score = 1000; Form1.lives = 3; ms.Focus(); }