Re: Tab key issue in Tab Control in Win32 SDK

Tech-Archive recommends: Fix windows errors by optimizing your registry



The tab control is embedded into a Dialog Box. The tab-control dialog boxes
are child to tab control and not the main dialog box. I hope this is correct
way of creating tab control. The child-dialog box have control like
editbox/list box etc. The main dialog box also has OK/CANCEL button.

I have few observations:
1. To implement basic tab functions i have to use WS_EX_CONTROLPARENT
setting for tab control and child dialog box. If i comment the setting from
child-dialog box i cannot navigate using tab for child tab dialog box.

2. If i comment all WS_EX_CONTROLPARENT for both tab and child-dialog and
keep it for just the main dialog Box. I can use tab to navigate OK/CANCEL
button and also switch the tabs using arrow key.
SetWindowLongPtr(hwnd,GWL_EXSTYLE,WS_EX_CONTROLPARENT);

3. But is do this and change the settings for tabcontrol also then it doesnt
work.

Leslie:
You are right that CTRL+TAB should be used to switch tabs - actually i
wanted some key to use for navigation. I mean like the tab and arrow
combination which work currently partially. I didnt do anything in code for
that though.

For having the CTRL+TAB function right now i think the work around for me
would to manually trap that message and switch tabs. Because i cant find
where the problem in my code is :( :(

"Leslie Milburn" wrote:

Hi,

WS_EX_CONTROLPARENT should be set on any Window that contains Child Windows,
I do not think it should be applied to controls themselves (ie the Tree
control).

With regards navigating the Tab control itself, TAB is not used to change
the current tab - it makes no sense because then how do you tab into the
actual controls themselves. Try CTRL - TAB and if you have programmed it
correctly, the current tab should change. Take a look at one of the standard
Windows dialogs - such as System Properties to see what I mean.

Leslie.

.


Quantcast