Click here to Skip to main content
15,901,853 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A solution in which i has a 2 forms in which when i click close button on top right on a form then before closing a form2 form 1 was been closed .......
Give me some sort of code for it..... :(
Posted

1 solution

I believe you want to close all the forms when the user clicks close on any of the forms. You can do this using Application.Exit method in the FormClosing event handlers.

Application.Exit will not raise FormClosing or FormClosed event. So if you have any code in those handlers, make sure you call Form.Close first. While doing so, please be careful that you do not end up with never ending loops which will cause exceptions.
 
Share this answer
 
Comments
Neeil 15-Nov-10 0:38am    
thanx u ...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900