I have 2 forms, form1
is the menu, with the buttons start
, settings
, quit
, and form2
is where the program will run.
The problem I face is that if the user uses Alt+F4 on form2
, it closes form2
, but form1
runs in the background. I know I can use the form2
Closing
event, so it can run an Environment.Exit(0)
, but that closing event also "activates" if I use the form2
"Back to Menu" button, which closes form2
. I also tried just hiding form2
with the Menu button, but then when I need to call another form2
, it opens up a new instance of it.
So, in summary: ALT+F4 should close the whole application, not just the current form, but can't use form2
Closing
event, because I want to close form2
some other way too.