Stop a from form closing
Hello,
I'm creating a editor, like notepad.
But i've this problem.
I don't know how to stop the program from closing.
Here is a code i would like to use:
Code:Dim msgResult As MsgBoxResult
Private Sub Form1_Closing(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Me.Closing
msgResult = MsgBox("Do you want to save the document?", MsgBoxStyle.Information + MsgBoxStyle.YesNoCancel, "Question")
If msgResult = MsgBoxResult.Cancel Then
'Stop's the form from closing code
ElseIf msgResult = MsgBoxResult.Yes Then
'Save code
End If
End Sub
I want the code for stopping the form from closing.
Greetings CPS

