How do I detect if that button is clicked on a form (cross button)
thx !
6f6
Printable View
How do I detect if that button is clicked on a form (cross button)
thx !
6f6
The form's closing event gets raised. Is that what you want? If you want to prevent the form from closing, you can set your CancelEventArgs e to True.
I think he means how can he tell if that button was clicked versus lets say windows shutting down the program because windows itself is shutting down, or its shutting down because code told it to
there is code to determine if its closing because the X was clicked.. search the VB.NET forum for QueryUnload because that is the feature of VB6 that is not present in .NET, and I know this was asked before