I made this code and it now shows 2 times the messagebox don't see why it does it twice:
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
DialogResult dlgResultStop;
dlgResultStop = MessageBox.Show("Are you sure you want to stop playing tetris?","Stop tetris?" ,MessageBoxButtons.YesNo,MessageBoxIcon.Exclamation);
if (dlgResultStop == DialogResult.Yes)
{
Application.Exit();
}
else if(dlgResultStop == DialogResult.No)
{
e.Cancel = true;
}
}
Extra: I would also like that all forms in my application are only able to be opened once in my application, can I use this event for it and how should I then?
thanx