The Closing event occurs when a Form is being closed. If this event is cancelled, the Form remains open. To cancel the closure of a Form, set the Cancel property of the CancelEventArgs passed to event handler to True.
Private Sub FormClosing(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.