Press F1 in Textbox1 to do this
I am still trying to get my head around the use of functions in my applications so I may not be explaining this clearly but .... I will try my best to be clear as I possibly can.
I have a form where I have 5 different text boxes. Lets say textbox 1 through 5. How do I write a function like the one below for use of all 5 controls.
The catch is that I need to know which textbox is responsible for the key down. So that if I am in textbox1 and press F1 I will get a message specific to textbox1.
Code:
Dim intKey As Integer
intKey = e.KeyCode
Select Case intKey
Case Keys.F1
MsgBox("F1 Pressed")
Case Keys.F2
MsgBox("F2 Pressed")
Case Keys.F3
MsgBox("F3 Pressed")
Case Keys.F4
MsgBox("F4 Pressed")
Case Keys.F5
MsgBox("F5 Pressed")
End Select
Thanks and I hope that makes sense.