Key_Down event problem [Resolved]
Ok... Im trying to run this code:
VB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
LockWorkStation
End If
End Sub
which in turn should execute this code:
VB Code:
Private Declare Function LockWorkStation Lib "user32.dll" () As Integer
But nothing at all is happening when the form loads and you hit the 'F2' key. Any thoughts?
Re: Key_Down event problem
Set the form's KeyPreview property to True.
Re: Key_Down event problem [Resolved]