How do you check to see if someone is pressing multiple keys (i.e.-Alt+F4). Because I need to check and see if the user presses 'SHIFT + TAB' while inside a textbox.
------------------
Ryan
Printable View
How do you check to see if someone is pressing multiple keys (i.e.-Alt+F4). Because I need to check and see if the user presses 'SHIFT + TAB' while inside a textbox.
------------------
Ryan
Use KeyDown event. See VB online help for details.
The Keydown Event passes a Shift Value which indicates wether SHIFT,CTRL or ALT is Pressed in Combination with the KeyCode Value, ie.------------------Code:Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyTab And (Shift And vbShiftMask) = vbShiftMask Then
Caption = "SHIFT + TAB"
End If
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]
Certified AllExperts Expert
Ya know what though, for some reason I cannot get the KeyDown event to recognize the Tab key. I've used a break point at the beginning of the KeyDown event and it doesn't even go into the event code. I don't know why, everything I've read, says it should work, but it's not working.
------------------
Ryan