In a Win32 API C ++ project, I have a tab dialog (3 tabs) and 3 dialog boxes that are children of the tab control. I load the main dialog using a tab control using DialogBoxParam, and child dialogs from resources using CreateDialogParam. The main dialog box appears with child dialogs. Clicking on the tabs shows / hides the correct child dialog, everything works fine.
After searching for tab orders, I found the style WS_EX_CONTROLPARENTto set in the tab control to make tabbing work in child dialogs. This works fine, except for one problem: the tab control itself never focuses, so I cannot go to the tab control to go to another tab using the keyboard. The keyboard focus goes through the child dialog, the buttons in the main dialog, and then back to the child dialog and never stops on the tab control itself, so I need to click on the tab control to change the tabs. It drives me crazy. Any suggestions?
Update. I managed to get around this problem by completely forgetting about WS_EX_CONTROLPARENTand making child dialogs a child of the tab control. It seems that only the side effect is more problematic for the controls during the redraw, but will still respond to it, since creating child dialogs of the child elements of the tab seems cleaner.
source
share