Private Sub frmMyForm_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
If MessageBox.Show("Change has been made to this form. Do you want to continue?", "Are you sure?", MessageBoxButtons.YesNo) = System.Windows.Forms.DialogResult.Yes Then
e.Cancel = True
End If
End Sub
At, that time we just need to cancle closing event. Nothing else otherwise form will be closed whatever you have write.
No comments:
Post a Comment