Link to home
Start Free TrialLog in
Avatar of joker1
joker1

asked on

Displaying multiple pages

In my application I have to display different pages on the screen. I want to create one dialog-template for each page and then display this dialog-template in a specified area in the "mother-window". What's the BEST way to do this? I tried out the CPropertsSheet-Class, but I'm not very satisfied with it.
Avatar of Tommy Hui
Tommy Hui

The CPropertySheets class is useful if the user only needs to see one at a time and each dialog template is a separate category. If the dialog templates are steps in a sequence, then a wizard (CPropertySheet::SetWizardMode()).

However, if the user needs to see more than one dialog template at a time, CPropertySheet is not for you. Instead, I would choose to use modeless dialogs for each and then you can either hide or show them when necessary.

If there is any relationship between the dialog templates, then you may want to consider using splitters or "a window layout manager" to manage them. A window layout manager isn't part of MFC, it is something you would need to write that would manage how these windows are related to each other. For example, you might want to have dialog one always be on top of dialog two. A layout manager would take care of that.
Avatar of joker1

ASKER

Thanks for your answer. I like to leave the question open for a few days. If your answer is the best, I'll give you the points.
Hi,

Why don't you use the templates to create separate dialog boxes, but set their styles to be without caption or border.
When you want to display them over some parent window, create them using CDialog::Create with style WS_CHILD and WS_VISIBLE and set the parent window to the Master dialog box.
When you want them gone, just call CWnd::ShowWindow(SW_HIDE) to hide them, or destroy them altogether with CWnd::DestroyWindow.

Avatar of joker1

ASKER

I tried this out today. I think it will work fine. Please post your comment as an answer so I can give you the points.
ASKER CERTIFIED SOLUTION
Avatar of PavelY
PavelY

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