Tab Key

  • Thread starter Thread starter meicher
  • Start date Start date
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
 
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.
 
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
 
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.
 
Back
Top