probably someone already have had same problem since creating tab controls is common thing for easy options manipulation

I have main dialog and on it I have tab control which show/hides various tab-dialogs with child controles, depending on which tab is selected
now problem is that tab button from keyboard, that is used for changing focus on child controls doesnt work correctly, I cant make it work to change focus on tab child dialog controles, it can be only set to change focus to: tab, OK and CANCEL buttons in main dialog... what i want is to be possible to change focus of controls inside tab dialogs too

I created main dialog and other sub-dialogs (used within tab control) using resources, if this have to do anything with this problem

any suggestion?
Posted on 2002-11-17 18:59:30 by Mikky

I was looking into this problem myself recently. I thought it might be a combination of using WS_TABSTOP and setting the extended style
The window itself contains child windows that should take part in dialog box navigation. If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic.

But in whatever combination I chose of using the styles in the rc file I couldn't get the TAB key working within the Tabbed dialog child controls themselves. The situation you've got with a control of a Tab sheet is sort of a Child of a Child of a Parent, rather than just a straight child/parent relationship, so this might be part of the problem.

The thing is, where is the TAB key default message initially handled by Windows? Probably the main dialog proc, so the default TABbing would go to the child tab dialog main windows, not trickle down to the 'grandchildren' button and edit controls, so to speak ;) In theory setting the tabbed dialogs exstyle to WS_EX_CONTROLPARENT and the controls you want to service to WS_TABSTOP should work, but it didn't do the trick for me.

Unless there's a trick to setting up the rc file and/or subclassing then you might have to control wm_keydown on the TAB key and somehow direct it to your tabbed dialog child controls.

Posted on 2002-11-18 12:33:09 by Kayaker
The default TAB "navigation" handler is in IsDialogMessage, and this function is placed in the message loop if needed.
DialogBoxParam automatically calls this message for the dialog box it creates, as it has its own message loop.
Posted on 2002-11-18 16:03:09 by tenkey
I've been implementing this kind of thing using "property sheets" and the TAB key works as expected. If an implementation doesn't pass through the dialog box manager, it is only obvious that the TAB key must be trapped by subclassing the child windows.
Posted on 2002-11-20 03:06:59 by micmic
Try to do the controls parent is the dialog, not TabControl. And also WS_EX_CONTROLPARENT, I suppose, can not remember exactly. Check it out. I did it in the past. Here is the RadAsm tab control project which I modified.

Good Luck
Posted on 2002-11-26 15:42:39 by cakmak
I recenty had the same proubem with a group control (button class with group style). The problem was solved by using WS_EX_CONTROLPARENT for the group control and WS_TABSTOP for the children, and then calling IsDialogMessage for the group control, however, now the mnemonic of the group control doesn't appear to work anymore. Anyone know why? Or how to solve it (without having to check the caption for which character follows the '&' on every keypress)?
Posted on 2002-12-02 15:29:08 by Joshua