guyz i need your help. I want that everytime I press the ESC "ESCAPE key" there will be a message box popping out then will ask if I want to exit? then if I click the Yes button my Progrma Ends. I also used the form_closing event heres my code. .
Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
If MsgBox("Are you sure you want to exit?", MsgBoxStyle.Question + MsgBoxStyle.YesNo, "Exit") = MsgBoxResult.Yes Then
End
Else
e.Cancel = True
End If
-------------------------------------------------------------------------------------
Private Sub frmMain_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Me.KeyPress
If Keys.Escape Then
frmMain_FormClosing(sender, e)
Else
End If
End Sub
hope you help me here...