Link to home
Start Free TrialLog in
Avatar of hasmet
hasmet

asked on

DlgItem on top of another DlgItem.

I have an edit control that is in a static group box. I also have a
checkbox with a title. I dont have any
title for static group box. I put my check box on top of  groupbox title
location so it looks like a title to the group. I put a lower tab order
for the group box than check box.
and also I selected a transparent
attr. for the checkbox.
so when checkbox is selected I make
controls in the group disabled.

It seems doing what I want, but is this
a good/proper way ? I try to use setwindowpos to set some z-order, but
that doesnot change any order on
this static group box.

again I see these type of dialogs
in windows/NT, and I want to make
sure the best/proper way to do this.

please put comment before locking
the question, I want to give the points to the most convincing answer.
Avatar of abancroft
abancroft

I have used this technique a few times.

I usually use it when there is some optional functionality that requires additional user input.

I believe it's good technique, because:
1. At a glance, the user can tell whether the functionality is enabled or not (the checkbox);
2. Also at a glance, the user can readily identify what extra input the additional functionality requires (the group box contains the controls);
3. It's obvious to the user that the check box controls the additional functionality (the combination of the check & group boxes);
4. For the programmer, it's very maintainable. In the resource editor it's obvious what's going on, with out having to examine code for SetWindowPos() calls. And MFC makes things like this soooooo easy. In general, visual editing is much quicker and informative than code.

Avatar of hasmet

ASKER

what are the attributes for
static group box and for check box ?
how is the tab order is playing role here ? is the group box upper border
going to be ever visible on top of the check box title and ruin the trick ?
ASKER CERTIFIED SOLUTION
Avatar of abancroft
abancroft

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial