Link to home
Start Free TrialLog in
Avatar of AlexPonnath
AlexPonnathFlag for United States of America

asked on

Which event fires when a user clicks the X to close a window...

In vb there was the unlaod event what is the equal to that in vb.net, i want to check before i despose the
window if there is any pendeng changes which need to be saved..

 
Avatar of richard_robinson
richard_robinson

You could try Form.Closing
Avatar of AlexPonnath

ASKER

but how do i cancel the closing once it hits the closing event ???

lets say i want to ask the customer if he is sure he doesnt want to save the data, if he says he wants to save the data before
how can i tell the form to abort the close..
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
        <execute your code>
    End Sub
ASKER CERTIFIED SOLUTION
Avatar of Erick37
Erick37
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial