Tab navigation between a tab control and the displayed controls

Tab navigation between a tab control and the displayed controls

Post by Rodrigo F. Alvar » Sat, 18 Oct 1997 04:00:00



Hi all,

I have a question that maybe wiser/more experience Win32 people can
answer...

A project I'm working on requires a modeless window with a tab control
to be implemented as a class (without using MFC) so that it can just
be Create()d, pages (also classes with event handlers) can be Add()ed
to it and it destroys itself on exiting.  The following is the way I
thought of doing it.

- Since doing it any other way seems to involve adding message-pump
hooks ( like IsDialogMessage() ), which I cannot do, I am implementing
it as a modeless window with its own thread and message pump.  This
effectively restricts contact to the moment of creation.

- The modeless window (of dialog class) has a child tab control dialog
and three children buttons (OK, Cancel, Apply).

- At the time of adding pages, tabs are added to the tab control with
their corresponding dialogs (the pages), which are dialog resources
(with WM_CHILD set and no border/caption) created with CreateDialog()
as children of the tab control.

- I handle making the pages visible/invisible, as well as redirecting
events to the corresponding page classes.

The problem is this:

I cannot, for the life of me, enable tab navigation of controls
between the tab control's tabs and the controls on the pages inside
the tab control display area.

I've tried the knowledge database, asked around, tried different
window styles, etc. to no avail.  I just cannot tab from the tabs to
the controls inside the display area.  A guy I wrote to told me
there's just no way of doing this, the only way is to use a property
sheet.

Any help would be appreciated!

-- Rodrigo

P.S. In my thread's message pump I do include IsDialogMessage()...

Thanks...

 
 
 

Tab navigation between a tab control and the displayed controls

Post by Valter Minut » Sat, 18 Oct 1997 04:00:00



> The problem is this:

> I cannot, for the life of me, enable tab navigation of controls
> between the tab control's tabs and the controls on the pages inside
> the tab control display area.

Did you ty to set DS_CONTROL on the child dialogs and
WS_EX_CONTROLPARENT for the parent one?
--
Valter Minute

www.fortech.it/english
------
Fog On Your Desktop Win '95 ScreenSaver (freeware):
http://gsanet.com/ntfiles/cmdl/download.cmdl?catagory=ScreenS&bbsfile...

------
If replying by email, remove the spam protection stuff "nospam",
from my return address.

 
 
 

1. Tab control: solution for TAB key navigation, ALT+ shortcuts

Let me re-cap the problem I was having, and what appears to be a solution
that nobody mentioned. Standard win32 API.

In a dialog box there is a tab control. To add different tab views (or
sheets) for use with this tab control, you can use CreateDialog and add
child dialog windows that are WS_CHILD.

This works, but the user can't use the TAB key to navigate the fields of
the dialog within the tab control. And keyboard shortcuts don't work. :(

If, for the tab control's child dialog window, you set DS_CONTROL or
WS_EX_CONTROLPARENT to try and allow for TAB navigation and keyboard
shortcuts, still no luck: the whole thing freezes up. There is an
infinite loop with WM_GETDLGCODE messages caused by the system tab
iterator.

What appears to be a solution is to set WS_EX_CONTROLPARENT for the tab
control itself, using something like:

SetWindowLong(hTab, GWL_EXSTYLE, WS_EX_CONTROLPARENT
        | GetWindowLong(hTab, GWL_EXSTYLE));

I've only tested this on Windows 2000 so far. Now the tab control can
have WS_CHILD dialog windows with DS_CONTROL (or WS_EX_CONTROLPARENT)
set, which makes the TAB key navigation and ALT+ shortcuts work.

Could there be any problems associated with this method?

--
Jem Berkes
http://www.pc-tools.net/
Windows, Linux & UNIX software

2. Harddisk?

3. How to control the tab order in dialog with a tab control?

4. Why UDesktop::DragDeskWindow()?

5. Adding TAB key SHIFT+TAB navigation to a Window

6. windows Me - left to right languages support

7. Tab control navigation

8. Tabbing in the tab common control

9. Article: Implementing drag 'n drop tab sorting in a tab control

10. Tab order with a tab control

11. Disabling tabs in a tab control

12. tabbing in subdialog of tab control of CDialog blows up