//creating dialog to show the pauseform public static DialogResult Show() { pauseForm = new PauseForm(); pauseForm.StartPosition = FormStartPosition.CenterParent; pauseForm.ShowDialog(); return(buttonResult); }
public void Pause() { if (gameTimer.Enabled == true) { gameTimer.Enabled = false; DialogResult dr = PauseForm.Show(); if (dr == DialogResult.Cancel) { gameTimer.Enabled = true; } else if (dr == DialogResult.Abort) { Form form = this.FindForm(); MenuScreen ms = new MenuScreen(); ms.Location = new Point((form.Width - ms.Width) / 2, (form.Height - ms.Height) / 2); form.Controls.Add(ms); form.Controls.Remove(this); } } }