Tab Key

M

meicher

Hello,
The TAB key is for changing the focus between the controls.
Now I want to catch the TAB key event in one of my controls
(Form class). I don't want to change the focus in this case.
I need the TAB key event within this control.
Has anyone an idea ? :?:
Regards mike
 
G

gabriel

meicher said:
Hello,
The TAB key is for changing the focus between the controls.
Now I want to catch the TAB key event in one of my controls
(Form class). I don't want to change the focus in this case.
I need the TAB key event within this control.
Has anyone an idea ? :?:

Define the OnKeyDown even in your form and turn KeyPreview on in your form
as well.
 
M

meicher

Sorry guys,
It doesn't work. I tried it.
The other controls are the problem. They should change the focus with
the TAB key.
The focus changes first after pressing the TAB key. The key event
appears in the next focused control.

Regard mike
 
G

gabriel

meicher said:
The other controls are the problem. They should change the focus with
the TAB key.

Figure it out, it's all right in front of you. You can find out which
control is current from your handler. If the current control is the one
you want to trap tabs for then trap it, otherwise do nothing and set
handled to false so the form processes the tab.

It's all right there.
 

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