private void playAgainButton_Click(object sender, EventArgs e) { // Goes to the game screen LevelScreen ls = new LevelScreen(); Form form = this.FindForm(); form.Controls.Add(ls); form.Controls.Remove(this); ls.Location = new Point((form.Width - ls.Width) / 2, (form.Height - ls.Height) / 2); }
private void playAgainButton_Click(object sender, EventArgs e) { storeScore(); #region change screen Form f = this.FindForm(); f.Controls.Remove(this); LevelScreen ls = new LevelScreen(); f.Controls.Add(ls); ls.Focus(); #endregion }