Private Sub Account_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
Dim CloseAnswer As Integer
CloseAnswer = MsgBox("Are you sure you want to close this form?", MsgBoxStyle.YesNo)
If CloseAnswer = 6 Then
the user wants to continue quitting
Me.Close()
Else
the user has changed his/hers mind
e.Cancel = True
End If
End Sub