HI there, on a form closing sub i have a msgbox asking if you want to close the form. If i click No how can i stop the form from closing its self? Is there a simple way, in 6 you used to be able to do a cancel or something.
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
If (MessageBox.Show("Do You Wish To Exit", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation) = DialogResult.No) Then
e.Cancel = True 'Do not close form
End If
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.