How to dynamically set the tab order of dialog controls

How to dynamically set the tab order of dialog controls

Post by Kedar R. Kelka » Thu, 27 Apr 2000 04:00:00



Hi all,

How can I set the tab order of dialog controls on the fly. Here is the case:
I am adding some third party control on my dialog. For determining the size
and position of this new control, I am putting a static control in the
dialog template and them creating the custom control on top of this control.
However, I lose tab settings after this. The newly added control is never in
the proper tab order.

Is there a way to dynamically set this order?

Thanks
~Kedar

 
 
 

How to dynamically set the tab order of dialog controls

Post by Check Abdou » Thu, 27 Apr 2000 04:00:00


You can use

        SetWindowPos(..) to set the tab order.

Cheers
Check Abdoul
----------------



Quote:> Hi all,

> How can I set the tab order of dialog controls on the fly. Here is the
case:
> I am adding some third party control on my dialog. For determining the
size
> and position of this new control, I am putting a static control in the
> dialog template and them creating the custom control on top of this
control.
> However, I lose tab settings after this. The newly added control is never
in
> the proper tab order.

> Is there a way to dynamically set this order?

> Thanks
> ~Kedar


 
 
 

How to dynamically set the tab order of dialog controls

Post by Ajay Kalr » Thu, 27 Apr 2000 04:00:00


Tab order is really Z order. Use SetWindowPos to alter it.

--
Ajay Kalra

Microsoft VC++/MFC MVP

Note: Please post all replies to newsgroup only.



Quote:> Hi all,

> How can I set the tab order of dialog controls on the fly. Here is the
case:
> I am adding some third party control on my dialog. For determining the
size
> and position of this new control, I am putting a static control in the
> dialog template and them creating the custom control on top of this
control.
> However, I lose tab settings after this. The newly added control is never
in
> the proper tab order.

> Is there a way to dynamically set this order?

> Thanks
> ~Kedar

 
 
 

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. How do I do a share exchange?

3. customize common dialog, how to set the tab order ?

4. Software

5. Getting tab order for a dialog control

6. external call forward Norstar

7. Help finding tab order of dialog control?

8. UNIX WordPerf snafu

9. Tab order with a tab control

10. tab order problem (dialog with activex inside other dialog)

11. Setting initial focus to controls in tab dialogs

12. Ctrl-tab and tab control in a dialog

13. Tab sequence in dialogs with tab controls