Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. private void Button1_Click(object sender, EventArgs e)
  2. {
  3. DialogResult dialogResult = MessageBox.Show("Would you like to play again?", "No would result in the application closing"), MessageBoxButtons.YesNo;
  4. if (dialogResult == DialogResult.Yes)
  5. {
  6. Application.Exit();
  7. }
  8. else if (dialogResult == DialogResult.No)
  9. {
  10. MainWindow window1 = new MainWindow();
  11. window1.Show();
  12. this.Close();
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement