• Welcome to Valhalla Legends Archive.
 

Question....

Started by OuTLawZGoSu, August 09, 2003, 11:38 AM

Previous topic - Next topic

OuTLawZGoSu

Sup.. How can i add a shortcut key. EX: i need for a form to close wen i press Esc. can someone give me that code?

Thx

L8terZ

drivehappy

This works if focus is set to the Form:

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
   If KeyCode = vbKeyEscape then
        Unload Me
        ' If you want it to end the program use this in conjunction with Unload Me: End
   End If
End Sub