KeyDown event (Display object)

Occurs when you press a key while the display is active.
If an object has input focus, the KeyDown event is generated for the object before the event is generated for the display, but both will occur.
If the object with keyboard focus is a third-party embedded OLE object, the KeyDown event for the display will not occur.
Syntax
Display
_
KeyDown
(
ByVal
KeyCode
As Integer
,
ByVal
Shift
As Integer
)
where
Display
– is the name of a Display object variable that was dimensioned using the WithEvents keyword or the reserved name Display.
KeyCode
– is a constant of the type Integer, such as vbKeyF1 (the F1 key) or vbKeyHome (the Home key). To specify key codes use the constants in the Visual Basic object library.
Shift
– is a parameter of the type Integer that corresponds to the state of the Shift and Ctrl keys at the time of the event.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal