Does anyone know how to capture the f-keys in a Textbox
I have tried the keypress event but the event does not fire when pressing any f-keys ie : F2
Printable View
Does anyone know how to capture the f-keys in a Textbox
I have tried the keypress event but the event does not fire when pressing any f-keys ie : F2
StaticInc here is a cut and paste example of capturing the F4 key top open another form. This should be self explanatory but if you need more help just post back.
VB Code:
Public Sub capKeyDown_KeyDown(ByVal sender As Object, _ ByVal e As KeyEventArgs) Select Case e.KeyCode Case Keys.F4 If sender Is txtEmp Then Dim newForm As New frmShowEmp newForm.ShowDialog() ElseIf sender Is txtJobNumber Then Dim newForm As New frmShowJob newForm.ShowDialog() End If End Select End Sub Private Sub txtEmp_KeyDown(ByVal sender As Object, _ ByVal e As System.Windows.Forms.KeyEventArgs) _ Handles txtEmp.KeyDown capKeyDown_KeyDown(txtEmp, e) End Sub