hello,
i am trying to use a shortcut key for a button and below is the code i am using.
the thing is it is working only after i pressed the button once. when i run the application and click F2, it does not work. i have to click on the button once and then the shortcut key works. is that normal?
please advise.
thanks
i am trying to use a shortcut key for a button and below is the code i am using.
Code:
Private Sub btnNew_KeyDown(sender As Object, e As System.Windows.Forms.KeyEventArgs) Handles btnNew.KeyDown
If e.KeyCode = Keys.F2 Then
btnNew.PerformClick()
End If
End Sub
please advise.
thanks