Trapping the Tab key 
Author Message
 Trapping the Tab key

In my VB 6 app, I want to store to a variable the last key the user pressed.
However, it seems that the Tab key (and maybe others) are not trappable.  I
have KeyPreview set to True but my form level KeyDown function doesn't
respond to the Tab key being pressed.  Is there a way to do this?

Thanks very much.



Sun, 08 Jun 2003 23:35:19 GMT  
 Trapping the Tab key

Hi.

Quote:
>In my VB 6 app, I want to store to a variable the last key the user pressed.
>However, it seems that the Tab key (and maybe others) are not trappable.  I
>have KeyPreview set to True but my form level KeyDown function doesn't
>respond to the Tab key being pressed.  Is there a way to do this?

I can't reproduce this behaviour. For me, Tab gives KeyCode = 9 in the
KeyDown event.

Gale.



Mon, 09 Jun 2003 00:06:15 GMT  
 Trapping the Tab key


Quote:
> In my VB 6 app, I want to store to a variable the last key the user
pressed.
> However, it seems that the Tab key (and maybe others) are not trappable.
I
> have KeyPreview set to True but my form level KeyDown function doesn't
> respond to the Tab key being pressed.  Is there a way to do this?

The TabStop property of EVERY control on your form must be False before VB
will let you trap the Tab key.


Mon, 09 Jun 2003 01:20:21 GMT  
 Trapping the Tab key
Add another tabbable control to the form.

- Jim



Quote:

> Hi.

> >In my VB 6 app, I want to store to a variable the last key the user
pressed.
> >However, it seems that the Tab key (and maybe others) are not
trappable.  I
> >have KeyPreview set to True but my form level KeyDown function
doesn't
> >respond to the Tab key being pressed.  Is there a way to do this?

> I can't reproduce this behaviour. For me, Tab gives KeyCode = 9 in the
> KeyDown event.

> Gale.

Sent via Deja.com
http://www.deja.com/


Mon, 09 Jun 2003 01:54:57 GMT  
 Trapping the Tab key

Hi.

Quote:
>Add another tabbable control to the form.

But I had all controls disabled so that the Form KeyPreview would pick
up the Tab key.

Gale.

Quote:

>- Jim



>> Hi.

>> >In my VB 6 app, I want to store to a variable the last key the user
>pressed.
>> >However, it seems that the Tab key (and maybe others) are not
>trappable.  I
>> >have KeyPreview set to True but my form level KeyDown function
>doesn't
>> >respond to the Tab key being pressed.  Is there a way to do this?

>> I can't reproduce this behaviour. For me, Tab gives KeyCode = 9 in the
>> KeyDown event.

>> Gale.

>Sent via Deja.com
>http://www.deja.com/



Mon, 09 Jun 2003 02:08:32 GMT  
 Trapping the Tab key
Ah, you didn't mention that in your post.

- Jim



Quote:

> Hi.

> >Add another tabbable control to the form.

> But I had all controls disabled so that the Form KeyPreview would pick
> up the Tab key.

> Gale.

> >- Jim



> >> Hi.

> >> >In my VB 6 app, I want to store to a variable the last key the
user
> >pressed.
> >> >However, it seems that the Tab key (and maybe others) are not
> >trappable.  I
> >> >have KeyPreview set to True but my form level KeyDown function
> >doesn't
> >> >respond to the Tab key being pressed.  Is there a way to do this?

> >> I can't reproduce this behaviour. For me, Tab gives KeyCode = 9 in
the
> >> KeyDown event.

> >> Gale.

> >Sent via Deja.com
> >http://www.deja.com/

Sent via Deja.com
http://www.deja.com/


Sun, 15 Jun 2003 22:10:30 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. how to trap shift-tab key

2. Can you trap the TAB key?

3. Trapping the Tab Key

4. VB5 - How Do I Trap the TAB key?

5. Trapping the tab key...

6. How to trap the TAB key press.

7. Trapping the TAB Key

8. trapping the TAB key

9. Trapping the TAB key

10. Can you trap the TAB key?

11. Trapping the tab key

12. How do I trap the TAB key?

 

 
Powered by phpBB® Forum Software