Private Sub frmDashboard_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Dim vAns As String = String.Empty Try vAns = MessageBox.Show("You will be logout from the system. Do you wish to continue?" & vbCrLf & _ "Click YES to logout." & vbCrLf & _ "Click NO to logout and terminate this system." & vbCrLf & _ "Click CANCEL to stay on system", "Confirmation!", MessageBoxButtons.YesNoCancel) If vAns = "0" Then ' Logout and back to login form ElseIf vAns = "1" Then ' Logout and terminate application ElseIf vAns = "2" Then ' Stay on current form End If Catch ex As Exception End Try End Sub
e.Cancel
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)