How to catch an event when UserControl disposing.
-
How to manage an event like OnClose, to do some actions before the moment some UserControl close. I need to have a way to cancel Closing. Thanx.
The cancel has to be done at the form level and you use the OnClosing and setting the e.Cancel property to true. Good luck!
Theres light at the end of the tunnel, hope it ain't no train.
-
The cancel has to be done at the form level and you use the OnClosing and setting the e.Cancel property to true. Good luck!
Theres light at the end of the tunnel, hope it ain't no train.
So, I handle OnClosing for a Form, and check all UserControls, belonging to the Form, for some state. If the state is not "right", I set e.Cancel to true. Ok... But how I can reach all UserControls belonging to the Form if I have nested containers like TabPages and Panels?