Trapping shift key strokes

liunx

Guest
I'm just trying to trap a stroke of the shift key, but I can't seem to get it to work. I can trap any other given key stroke... G, F, Enter, Space, whatever, but not any of the Shift keys. I've tried all of them. Here's my bit of testing code:


If Asc(e.KeyChar) = Keys.LShiftKey Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.RShiftKey Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.Shift Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.ShiftKey Then
e.Handled = True

ElseIf Asc(e.KeyChar) = Keys.Space Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.Enter Then
e.Handled = True
ElseIf Asc(e.KeyChar) = Keys.F Then
e.Handled = True
End IfNevermind. Got it. Wrong event. Silly me.
 
Back
Top