(e.KeyCode = Keys.Tab) does not work?

  • Thread starter Thread starter strah
  • Start date Start date
S

strah

I am trying to detect when a user uses Tab key while with the KeyDown
event of the combobox. It seems to work fine with all the Keys (Enter,
T, ...) but not with the Tab key (e.KeyCode = Keys.Tab). Anyone
experienced similar problems? Any solutions, workarounds? thanks

Private Sub ComboBox1_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown


If e.KeyCode = Keys.Tab Then
Debug.WriteLine("hello") 'THIS NEVER PRINTS
End If

If e.KeyCode = Keys.Enter Then
Debug.WriteLine("hello") 'THIS PRINTS AS EXPECTED
End If

end sub


Strah
 
Back
Top