I have 2 forms, one does the auth, and when verified, opens form2 and then form1 needs to close.
If I just hide it, when you click the exit button on form2, the program doesn't close (form1 is still in memory). What's the easiest way to fix this?
This is a discussion on [C#] Form Help within the Source Code Samples forums, part of the Programming category; I have 2 forms, one does the auth, and when verified, opens form2 and then form1 needs to close. If ...
I have 2 forms, one does the auth, and when verified, opens form2 and then form1 needs to close.
If I just hide it, when you click the exit button on form2, the program doesn't close (form1 is still in memory). What's the easiest way to fix this?
Rawr.
Just add Application.Exit() method to second forms closed event.
What is the closing event?
Rawr.
Click on the form right click go to properties then click the little lightning bolt and scroll down the forms closed event.
Do this for an exit button,
Or put in the form closing even for form2,Code:Environment.Exit(0)
Code:form1.close()