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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top