Tab sequence in dialogs with tab controls

Tab sequence in dialogs with tab controls

Post by Ulrich von Engelber » Tue, 28 Oct 1997 04:00:00



Hi,

I have a problem with tab controls:
I am using a tab ctrl in a modal dialog. The tab control itself contains
several child dialogs of which only one is visible at a time - depending on
the selected tab.

When tabbing forward through the dialog with the Tab key, the focus should
switch
- from the control before the tab control to the active tab itself,
- then to the first control in the tab control's active child dialog,
- then to the next control in the child dialog and so on to the last,
- then to the next control following the tab control
Tabbing backward should work analogously.

Though I keep experimenting with the WS_TABSTOP and  WS_EX_CONTROLPARENT
style flags, there seems to be no possible way. Either the dialog "hangs"
after pressing the Tab key, or some items are skipped.

Is there any solution easier than intercepting the Tab key and handling the
tabbing in the program?

Thanks in advance, Uli

 
 
 

Tab sequence in dialogs with tab controls

Post by Matt Arnol » Tue, 28 Oct 1997 04:00:00


I think you are using the wrong style.  WS_EX_CONTROLPARENT is apparently
intended for non-dialog windows that contain controls.

For what you're trying to do, you need to be sure to give your *sub-dialogs*
the DS_CONTROL and WS_CHILD styles.  Then, the Windows dialog manager should
automatically handle normal tabbing between the main parent dialog's and
each of the child sub-dialogs' controls as if there were all part of one
giant dialog.

Note that DS_CONTROL is not available under Windows 3.1 and versions of
Windows NT prior to 4.0.  Under those environments, the child sub-dialogs
will work properly with the mouse, but keyboard tabbing won't.  If you want
to run under 3.1 or pre-4.0 NT with proper tabbing you will have to
implement it yourself.

Best regards,
Matt Arnold
Boston, USA :: http://python.ics.uci.edu/~marnold/
C++/MIDI/Win32/95 developer :: e/DM/7R7/RF/C&E/A-Box

Remove "kill.da.spam." prefix to obtain my valid email address.


Quote:>Hi,

>I have a problem with tab controls:
>I am using a tab ctrl in a modal dialog. The tab control itself contains
>several child dialogs of which only one is visible at a time - depending on
>the selected tab.

>When tabbing forward through the dialog with the Tab key, the focus should
>switch
>- from the control before the tab control to the active tab itself,
>- then to the first control in the tab control's active child dialog,
>- then to the next control in the child dialog and so on to the last,
>- then to the next control following the tab control
>Tabbing backward should work analogously.

>Though I keep experimenting with the WS_TABSTOP and  WS_EX_CONTROLPARENT
>style flags, there seems to be no possible way. Either the dialog "hangs"
>after pressing the Tab key, or some items are skipped.

>Is there any solution easier than intercepting the Tab key and handling the
>tabbing in the program?

>Thanks in advance, Uli


 
 
 

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

I have a dialog which has a tab control and several other controls -- some
buttons and edit boxes.  A couple of the edit boxes are above the tab
control and a couple are below it.  The problem I have is with the tabbing
order.  When you tab through the controls in the dialog, the focus first
goes through the other controls in the dialog (the ones above and below
the tab control) and then the controls inside the tab control -- even
though the tab control is in the proper position in the dialog template.

I think what's happening is probably because the controls inside the tab
control in a dialog which is a child of the main dialog.  (I believe
that's the recommended way of doing it).  But it's very confusing for the
user for the tab order to work this way.

Is there an easy way of fixing this problem?  I know I could subclass the
appropriate controls in the dialog and handle the tab key myself, but I'd
prefer a more global solution (I have several dialogs like this).

I suspect that using property sheets would solve my problem, but switching
to property sheets isn't really practical for me.

Thanks for any assistance.
- Eric S.

2. cPCI hardware

3. Ctrl-tab and tab control in a dialog

4. Int or short int ?

5. Tab navigation between a tab control and the displayed controls

6. Media Player Fails to Play MPEGs

7. Capturing Cntrl-Tab in place of Tab for tab indexing

8. RasDial: logon network not executed

9. Tabbing in the tab common control

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

11. Tab order with a tab control

12. Disabling tabs in a tab control

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