Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Modeless dialogs & CPropertySheet's Wizard Mode

102 views
Skip to first unread message

Alex Agranov

unread,
Feb 6, 1998, 3:00:00 AM2/6/98
to

I need to create a wizard-type app, but since I can't use CPropertySheet in
Wizard mode(due to it's limitations on how I can customize it's buttons), I
have to somehow chain together a bunch of modeless dialogs. My main window
is a dialog. In it's OnInitDialog(), I hide it and then create my dialogs
for the wizard. Then I create my dialogs in OnInitDialog() of this main
dialog. The problem is that the first dialog becomes visible for a second
and then disappears. Has someone done this before and has some code that
shows how to do it correctly?

If anyone knows how to customize the Wizard buttons in CPropertySheet beyond
what is documented I would really appreciate. F.e., is there a way to
display Finish(with changed text) button along with Back and Next buttons?
This is very important.

Leah Garrett

unread,
Feb 9, 1998, 3:00:00 AM2/9/98
to

I think that you should be able to use a PropertSheet.

To change the text for the finish button use SetFinishText. Any further
changes you could inherit from CPropertyPage and put any customization in
there. Wrox's "Visual C++ 4.0 Masterclass" has some good examples of this.
See also the codeguru.com page.

To get the Application to look like a wizard you can create an AppWizard
Dialog based app. Delete the dialog and add some pages. Change the
initinstance to make the PropertySheet the main frame

CPropertySheet sheet("Sheet Name");
Page1 page1;
Page2 page2;
Page3 page3;
Page4 page4;
m_pMainWnd = &sheet;
sheet.AddPage(&page1);
sheet.AddPage(&page4);
sheet.AddPage(&page2);
sheet.AddPage(&page3);
sheet.SetWizardMode();
int nResponse = sheet.DoModal();

Before property sheets (16 bit) I had to create and manage dialog pages for
a wizard by hand, this is much much easier.

Hope this helps
Leah


Alex Agranov <alex_a...@cc.mcafee.com> wrote in article
<#YsSgN1M...@uppssnewspub05.moswest.msn.net>...

David Lowndes

unread,
Feb 9, 1998, 3:00:00 AM2/9/98
to

>If anyone knows how to customize the Wizard buttons in CPropertySheet beyond
>what is documented I would really appreciate. F.e., is there a way to
>display Finish(with changed text) button along with Back and Next buttons?

Alex,

Have a look at Knowledge Base article Q143210 "How to Add the Finish
Button to a Wizard Property Sheet".

Dave
----
Address is altered to discourage junk mail.
Remove ".---" for the real address.
http://www.bj.co.uk

Alex Agranov

unread,
Feb 11, 1998, 3:00:00 AM2/11/98
to

Thanks. It's helped.

David Lowndes wrote in message <34e63502...@sparcone.bj.co.uk>...

0 new messages