I have searched through stackoverflow and has found similar question.
As I am still a beginner in C# programming, I could not quite understand what the solutions meant.
I have a c# windows form application that has several forms.
As it only closes when I closes the main form, how do I code it such that when I close other form the application closes as well?
EDIT: most people has told me to code it in the closing event. may i know where is the event found at? thanks.
Not sure why you think out answers will be any easier than ones you have found already but..
A Form has an event called “Closing” (See Here). You should handle the event and then inside that function you can use the following line to close your application…
NOTE: This is for a WinForms application
EDIT:
You can register the closing event using VS designer mode like this…
More detailed answer here
(Google if you cannot work this out)
or you can register the event in code like this…