Is it possible to trap the ESC key during the execution of an mdi form? I want the esc key to be trapped and when it is pressed I want the current form to be unloaded. Is it possible?
Input api call in loop (heavy duty). In code window there is events for from, left side is object or function drop down combo you must chose form1 or however is your form called and on right side is event for objects also drop down combo (e.g. load, unload enc...) choose keydown.
Here is little code that will help you well it least i hope it will help.
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Const ESC = vbKeyEscape
If KeyCode = ESC Then
MsgBox "you pressed esscape"
End If
End Sub
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.