Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If e.KeyCode = Keys.Tab Then 'doesn't work

Status
Not open for further replies.

steve1rm

Programmer
Aug 26, 2006
255
GB
Hello,

I have the code below in a combo boxes keyup event. I want to do something then the user presses the tab key. But it does not work. I have tried this with other key i.e. enter, shift, letter, and numbers. But does not work when the user presses the tab key.

Does anyone know why this is.
Code:
If e.KeyCode = Keys.Tab Then
            'Do something then the user press the tab key
 End If

Thanks,

Steve
 
From MSDN
Certain keys, such as the TAB, RETURN, ESCAPE, and arrow keys are handled by controls automatically. To have these keys raise the KeyUp event, you must override the IsInputKey method in each control on your form. The code for the override of IsInputKey would need to determine if one of the special keys is pressed and return a value of true.

Hope this helps.

[vampire][bat]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top