Sub FrmForm1Closing(ByVal sender As Object, ByVal e As EventArgs)
If MessageBox.Show("Are you sure?", "EXIT APPLICATION", MessageBoxButtons.YesNo) = Windows.Forms.DialogResult.Yes Then
Me.Close
application.exit
End If
End sub
SharpDevelop
FormClosing
If MessageBox.Show("Sure to quit?", "", MessageBoxButtons.YesNo) == DialogResult.No
e.Cancel = True 'set the event cancel property to prevent app exiting
End If
End FormClosing
I recalled when using VB6
Exit Sub simply exits the sub. If you jump out the car before you run over the old lady, the car still runs over the old lady.that there is a cancel and a "Exit Sub" or "Exit Function" command.