Discussion:
Wizard in MFC !! (How do I design one?)
(too old to reply)
Jessica
2007-12-06 11:54:00 UTC
Permalink
Hello All,

I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.

I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.

Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.

MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!

Thanks In Advance!!
Jessy
Check Abdoul
2007-12-06 13:28:03 UTC
Permalink
Take a look at the CPropertySheetEx and CPropertyPage MFC classes.

Cheers
Check Abdoul
---------------------
Post by Jessica
Hello All,
I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
Scott McPhillips [MVP]
2007-12-06 14:36:15 UTC
Permalink
Post by Jessica
Hello All,
I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
MFC does most of it for you, in a better way. See
CPropertySheet::SetWizardMode
--
Scott McPhillips [VC++ MVP]
Jessica
2007-12-07 05:17:00 UTC
Permalink
Hello Scott,

Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?

Thanks again,
Jessy
Post by Scott McPhillips [MVP]
Post by Jessica
Hello All,
I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
MFC does most of it for you, in a better way. See
CPropertySheet::SetWizardMode
--
Scott McPhillips [VC++ MVP]
Tom Serface
2007-12-06 17:19:52 UTC
Permalink
Here's an article to go with what Check and Scott replied:

http://www.dotnetheaven.com/Uploadfile/bulentozkir/pp_wizard04212005064904AM/pp_wizard.aspx?ArticleID=c9495c38-5107-4f20-b3c9-e561e4451775

Tom
Post by Jessica
Hello All,
I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
Jessica
2007-12-07 05:18:00 UTC
Permalink
Hello Tom,

Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?

Thanks again,
Jessy
Post by Tom Serface
http://www.dotnetheaven.com/Uploadfile/bulentozkir/pp_wizard04212005064904AM/pp_wizard.aspx?ArticleID=c9495c38-5107-4f20-b3c9-e561e4451775
Tom
Post by Jessica
Hello All,
I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
Tom Serface
2007-12-07 07:33:51 UTC
Permalink
Maybe one of these ideas would work for you:

http://www.codeproject.com/KB/tabs/resizeable_wizard97.aspx

http://www.codeproject.com/KB/tabs/conquering_wizard97.aspx

The nice thing about the property sheet approach is that it really is just
like a bunch of dialogs that sequence. You can put all kinds of nice
graphics and text on each page to indicate where you are in the sequence.

Tom
Post by Jessica
Hello Tom,
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
Check Abdoul
2007-12-07 14:08:16 UTC
Permalink
Take a look at the "FormSwap" article by Paul Dilascia (C++ Q&A) in

Dec '98 MSJ magazine.

Cheers
Check Abdoul
---------------------
Post by Jessica
Hello Tom,
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
Thanks again,
Jessy
Post by Tom Serface
http://www.dotnetheaven.com/Uploadfile/bulentozkir/pp_wizard04212005064904AM/pp_wizard.aspx?ArticleID=c9495c38-5107-4f20-b3c9-e561e4451775
Tom
Post by Jessica
Hello All,
I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently
I
am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am
planning
to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
David Ching
2007-12-07 15:06:33 UTC
Permalink
Post by Jessica
Hello Tom,
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
There isn't any way of putting a PropertySheet into another dialog,
unfortunately. If you want to keep using the PropertySheet (and it is the
easiest way of creating a wizard), then you could make each "interior page"
(all pages except the first and last ones) show an image on the left side of
the page. This is what the first and last pages have by default. And the
image you show on the interior pages would have the list of steps, with the
one for the current page highlighted. But this is harder to localize, since
all of the text in the steps is put into a graphic.

-- David
David Wilkinson
2007-12-07 15:24:42 UTC
Permalink
Post by David Ching
Post by Jessica
Hello Tom,
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
There isn't any way of putting a PropertySheet into another dialog,
unfortunately. If you want to keep using the PropertySheet (and it is the
easiest way of creating a wizard), then you could make each "interior page"
(all pages except the first and last ones) show an image on the left side of
the page. This is what the first and last pages have by default. And the
image you show on the interior pages would have the list of steps, with the
one for the current page highlighted. But this is harder to localize, since
all of the text in the steps is put into a graphic.
David:

I've never done it, but I think you can put a modeless property sheet
inside a modal dialog (or anywhere).
--
David Wilkinson
Visual C++ MVP
Tom Serface
2007-12-07 15:32:39 UTC
Permalink
This code uses propertypages as separate child dialogs, but it displays them
on a dialog with a tree control to move from page to page.

http://www.codeproject.com/KB/dialog/csettingsdlg.aspx

Tom
Post by David Wilkinson
Post by David Ching
Post by Jessica
Hello Tom,
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
There isn't any way of putting a PropertySheet into another dialog,
unfortunately. If you want to keep using the PropertySheet (and it is
the easiest way of creating a wizard), then you could make each "interior
page" (all pages except the first and last ones) show an image on the
left side of the page. This is what the first and last pages have by
default. And the image you show on the interior pages would have the
list of steps, with the one for the current page highlighted. But this
is harder to localize, since all of the text in the steps is put into a
graphic.
I've never done it, but I think you can put a modeless property sheet
inside a modal dialog (or anywhere).
--
David Wilkinson
Visual C++ MVP
BobF
2007-12-07 16:11:13 UTC
Permalink
I've also done this with tabbed pp and ps on a dialog-based app. It works
very well.
Here's the OnInitDialog that does it:

BOOL CVMRDialog::OnInitDialog()
{
CDialog::OnInitDialog();

// load the menu
m_menu.LoadMenu(IDR_MAINFRAME);
SetMenu(&m_menu);
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_GRAYED);

OnChannelNew(); // adds the initial prop -page-

// create the property -sheet-
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);

// tighten up the size of the main dialog box
// to fit neatly around the prop pages
CMainDlg* pp = (CMainDlg*)m_propsheet.GetActivePage();
RECT rect;

// no need to call ScreenToClient - we're only using
// values for relative sizing
pp->GetWindowRect(&rect);
// get the tab rect so the tab height can
// be accounted for
CTabCtrl* tcp = m_propsheet.GetTabControl();
RECT trect;
tcp->GetItemRect(0, &trect);
SetWindowPos(NULL,
0,0,rect.left+rect.right,rect.bottom+(trect.bottom-trect.top),
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);

return TRUE;
}


And OnChannelNew (a menu selection):

void CVMRDialog::OnChannelNew()
{
CMainDlg *pnewChannel;
pnewChannel = new CMainDlg(this);
if (pnewChannel != NULL)
{
m_chList.insert(m_chList.end(), pnewChannel);
m_chIter = m_chList.end();
m_propsheet.AddPage(pnewChannel);
m_propsheet.SetActivePage(pnewChannel);
if (m_chList.size() > 1)
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_ENABLED);
}
else //pnewChannel != NULL
{
AfxMessageBox("New Port Create Failed");
}
}
Post by Tom Serface
This code uses propertypages as separate child dialogs, but it displays
them on a dialog with a tree control to move from page to page.
http://www.codeproject.com/KB/dialog/csettingsdlg.aspx
Tom
Post by David Wilkinson
Post by David Ching
Post by Jessica
Hello Tom,
Can I create a dialog, implement a left pane which displays the steps of the
wizard with the currently active step highlighted, and then put the
ProperySheet in the main area of the dialog? Or can I only display the
Propertysheet standalone in a frame?
There isn't any way of putting a PropertySheet into another dialog,
unfortunately. If you want to keep using the PropertySheet (and it is
the easiest way of creating a wizard), then you could make each
"interior page" (all pages except the first and last ones) show an image
on the left side of the page. This is what the first and last pages
have by default. And the image you show on the interior pages would
have the list of steps, with the one for the current page highlighted.
But this is harder to localize, since all of the text in the steps is
put into a graphic.
I've never done it, but I think you can put a modeless property sheet
inside a modal dialog (or anywhere).
--
David Wilkinson
Visual C++ MVP
David Ching
2007-12-07 16:50:02 UTC
Permalink
Post by BobF
I've also done this with tabbed pp and ps on a dialog-based app. It works
very well.
BOOL CVMRDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// load the menu
m_menu.LoadMenu(IDR_MAINFRAME);
SetMenu(&m_menu);
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_GRAYED);
OnChannelNew(); // adds the initial prop -page-
// create the property -sheet-
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
// tighten up the size of the main dialog box
// to fit neatly around the prop pages
CMainDlg* pp = (CMainDlg*)m_propsheet.GetActivePage();
RECT rect;
// no need to call ScreenToClient - we're only using
// values for relative sizing
pp->GetWindowRect(&rect);
// get the tab rect so the tab height can
// be accounted for
CTabCtrl* tcp = m_propsheet.GetTabControl();
RECT trect;
tcp->GetItemRect(0, &trect);
SetWindowPos(NULL,
0,0,rect.left+rect.right,rect.bottom+(trect.bottom-trect.top),
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
return TRUE;
}
void CVMRDialog::OnChannelNew()
{
CMainDlg *pnewChannel;
pnewChannel = new CMainDlg(this);
if (pnewChannel != NULL)
{
m_chList.insert(m_chList.end(), pnewChannel);
m_chIter = m_chList.end();
m_propsheet.AddPage(pnewChannel);
m_propsheet.SetActivePage(pnewChannel);
if (m_chList.size() > 1)
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_ENABLED);
}
else //pnewChannel != NULL
{
AfxMessageBox("New Port Create Failed");
}
}
Hey, neat! But does it look good? I'm not sure how the property sheet
header (the area at the top of each page which has the icon and boldface
subtitle) would look if that was spread across the property sheet child
wndow and not across the entire dialog?

Thanks,
David
BobF
2007-12-07 17:37:34 UTC
Permalink
If you're interested, I'll post a screenshot somewhere layer today or
tomorrow.
Post by David Ching
Post by BobF
I've also done this with tabbed pp and ps on a dialog-based app. It
works very well.
BOOL CVMRDialog::OnInitDialog()
{
CDialog::OnInitDialog();
// load the menu
m_menu.LoadMenu(IDR_MAINFRAME);
SetMenu(&m_menu);
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_GRAYED);
OnChannelNew(); // adds the initial prop -page-
// create the property -sheet-
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
// tighten up the size of the main dialog box
// to fit neatly around the prop pages
CMainDlg* pp = (CMainDlg*)m_propsheet.GetActivePage();
RECT rect;
// no need to call ScreenToClient - we're only using
// values for relative sizing
pp->GetWindowRect(&rect);
// get the tab rect so the tab height can
// be accounted for
CTabCtrl* tcp = m_propsheet.GetTabControl();
RECT trect;
tcp->GetItemRect(0, &trect);
SetWindowPos(NULL,
0,0,rect.left+rect.right,rect.bottom+(trect.bottom-trect.top),
SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE);
return TRUE;
}
void CVMRDialog::OnChannelNew()
{
CMainDlg *pnewChannel;
pnewChannel = new CMainDlg(this);
if (pnewChannel != NULL)
{
m_chList.insert(m_chList.end(), pnewChannel);
m_chIter = m_chList.end();
m_propsheet.AddPage(pnewChannel);
m_propsheet.SetActivePage(pnewChannel);
if (m_chList.size() > 1)
m_menu.EnableMenuItem(ID_CHANNEL_CLOSE, MF_ENABLED);
}
else //pnewChannel != NULL
{
AfxMessageBox("New Port Create Failed");
}
}
Hey, neat! But does it look good? I'm not sure how the property sheet
header (the area at the top of each page which has the icon and boldface
subtitle) would look if that was spread across the property sheet child
wndow and not across the entire dialog?
Thanks,
David
David Ching
2007-12-07 19:16:28 UTC
Permalink
Post by BobF
If you're interested, I'll post a screenshot somewhere layer today or
tomorrow.
Sure, it would be interesting to see. I think maybe your technique would be
better suited to non-Wizard 97 compliant wizards without the banner on top.

-- David
BobF
2007-12-08 14:52:03 UTC
Permalink
David - This is what it looks like:

Loading Image...
Post by David Ching
Post by BobF
If you're interested, I'll post a screenshot somewhere layer today or
tomorrow.
Sure, it would be interesting to see. I think maybe your technique would
be better suited to non-Wizard 97 compliant wizards without the banner on
top.
-- David
David Ching
2007-12-08 18:10:46 UTC
Permalink
Post by BobF
http://home.centurytel.net/bobf/mon.jpg
Wow, this looks great. I wanted to do something similar recently but ended
up sticking with a normal CTabCtrl. How did you get rid of the buttons on
the bottom which normally appear in a CPropertySheet? Also, for the record,
this really isn't a wizard, it is a PropertySheet but not used in wizard
mode, it is the mode with the tabs across the top. So that's why there is
no white banner on top to worry about.

Cheers,
David
BobF
2007-12-09 11:40:31 UTC
Permalink
Post by David Ching
Post by BobF
http://home.centurytel.net/bobf/mon.jpg
Wow, this looks great. I wanted to do something similar recently but
ended up sticking with a normal CTabCtrl. How did you get rid of the
buttons on the bottom which normally appear in a CPropertySheet? Also,
for the record, this really isn't a wizard, it is a PropertySheet but not
used in wizard mode, it is the mode with the tabs across the top. So
that's why there is no white banner on top to worry about.
Cheers,
David
I'm well aware of the fact that it's not a wizard. I was just demonstrating
that property sheets on dialogs is possible - to decent effect <g>

As far as the buttons go, since this wasn't created with a wizard wizard ...
I simply added a dialog through the resource editor and chose the prop page
type of dialog. This gives you the ability to make it what ever you want it
to be.
David Ching
2007-12-09 15:33:12 UTC
Permalink
Post by BobF
I'm well aware of the fact that it's not a wizard. I was just
demonstrating that property sheets on dialogs is possible - to decent
effect <g>
As far as the buttons go, since this wasn't created with a wizard wizard
... I simply added a dialog through the resource editor and chose the prop
page type of dialog. This gives you the ability to make it what ever you
want it to be.
What? Does your code use CPropertySheet and CPropertyPage or not? You
can't add either in the resource editor!

Thanks,
David
BobF
2007-12-09 16:05:19 UTC
Permalink
Post by David Ching
Post by BobF
I'm well aware of the fact that it's not a wizard. I was just
demonstrating that property sheets on dialogs is possible - to decent
effect <g>
As far as the buttons go, since this wasn't created with a wizard wizard
... I simply added a dialog through the resource editor and chose the
prop page type of dialog. This gives you the ability to make it what
ever you want it to be.
What? Does your code use CPropertySheet and CPropertyPage or not? You
can't add either in the resource editor!
Thanks,
David
It uses obviously them both. The prop pages are -created- with the resource
editor and -added- programmatically during run-time.
David Ching
2007-12-09 16:09:54 UTC
Permalink
Post by BobF
It uses obviously them both. The prop pages are -created- with the
resource editor and -added- programmatically during run-time.
What's throwing me off is the that in a normal CPropertySheet, there are
OK/Cancel/Apply buttons beneath the tabs. These don't appear in your screen
shot. How did you hide them?

Thanks,
David
BobF
2007-12-09 16:20:04 UTC
Permalink
Post by David Ching
Post by BobF
It uses obviously them both. The prop pages are -created- with the
resource editor and -added- programmatically during run-time.
What's throwing me off is the that in a normal CPropertySheet, there are
OK/Cancel/Apply buttons beneath the tabs. These don't appear in your
screen shot. How did you hide them?
Thanks,
David
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);

are the lines which create the sheet. By default, this creates a tabbed
dialog.

To get buttons instead of tabs would require calling SetWizardMode as shown
here:

<http://msdn2.microsoft.com/en-us/library/1sse9730(VS.80).aspx>
David Ching
2007-12-09 16:40:08 UTC
Permalink
Post by BobF
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
are the lines which create the sheet. By default, this creates a tabbed
dialog.
To get buttons instead of tabs would require calling SetWizardMode as
<http://msdn2.microsoft.com/en-us/library/1sse9730(VS.80).aspx>
Look at http://www.microsoft.com/msj/0398/c0398.aspx and scroll down mid-way
to Figure 6. That's what my understanding of a CPropertySheet in non-wizard
mode looks like. It has the OK/Cancel/Apply buttons. Are you saying that
if you create the propertysheet with the WS_CHILD style, it doesn't have
those buttons? If so, that is major cool.

Thanks,
David
BobF
2007-12-09 16:51:06 UTC
Permalink
Post by David Ching
Post by BobF
m_propsheet.Create(this, WS_CHILD|WS_VISIBLE);
m_propsheet.ModifyStyleEx(0, WS_EX_CONTROLPARENT);
are the lines which create the sheet. By default, this creates a tabbed
dialog.
To get buttons instead of tabs would require calling SetWizardMode as
<http://msdn2.microsoft.com/en-us/library/1sse9730(VS.80).aspx>
Look at http://www.microsoft.com/msj/0398/c0398.aspx and scroll down
mid-way to Figure 6. That's what my understanding of a CPropertySheet in
non-wizard mode looks like. It has the OK/Cancel/Apply buttons. Are you
saying that if you create the propertysheet with the WS_CHILD style, it
doesn't have those buttons? If so, that is major cool.
Thanks,
David
:-)) I've shown you everything I did with the prop sheet,
so I guess it *is* 'Major Kool', although I'm not sure it is the
WS_CHILD style that does the trick. If I understand it correctly,
not setting wizard mode is what does the trick.
David Wilkinson
2007-12-09 17:51:20 UTC
Permalink
Post by David Ching
Look at http://www.microsoft.com/msj/0398/c0398.aspx and scroll down mid-way
to Figure 6. That's what my understanding of a CPropertySheet in non-wizard
mode looks like. It has the OK/Cancel/Apply buttons. Are you saying that
if you create the propertysheet with the WS_CHILD style, it doesn't have
those buttons? If so, that is major cool.
David:

If you look in "The MFC Answer Book" by Eugene Kain (which is easy for
me because I have a copy sitting on my lap...) there is a whole section
on embedding (non-Wizard) property sheets in a dialog. The example
illustrations do not show the standard property sheet buttons, and I do
not see anything in the example code that removes them.
--
David Wilkinson
Visual C++ MVP
BobF
2007-12-09 18:07:56 UTC
Permalink
Post by David Ching
Look at http://www.microsoft.com/msj/0398/c0398.aspx and scroll down
mid-way to Figure 6. That's what my understanding of a CPropertySheet in
non-wizard mode looks like. It has the OK/Cancel/Apply buttons. Are you
saying that if you create the propertysheet with the WS_CHILD style, it
doesn't have those buttons? If so, that is major cool.
If you look in "The MFC Answer Book" by Eugene Kain (which is easy for me
because I have a copy sitting on my lap...) there is a whole section on
embedding (non-Wizard) property sheets in a dialog. The example
illustrations do not show the standard property sheet buttons, and I do
not see anything in the example code that removes them.
That's because they are tabbed by default. You either get tabs or buttons
:-)
David Ching
2007-12-09 20:00:01 UTC
Permalink
Post by BobF
That's because they are tabbed by default. You either get tabs or buttons
:-)
No Bob, with the tabs you get OK/Cancel/Apply buttons, and with Wizard you
get Back/Next/Cancel/Finish buttons. Either mode you get buttons!

-- David
BobF
2007-12-09 21:02:22 UTC
Permalink
Post by David Ching
Post by BobF
That's because they are tabbed by default. You either get tabs or
buttons :-)
No Bob, with the tabs you get OK/Cancel/Apply buttons, and with Wizard you
get Back/Next/Cancel/Finish buttons. Either mode you get buttons!
Then why doesn't mine have buttons? I did nothing to make them go away
David Ching
2007-12-09 20:00:36 UTC
Permalink
If you look in "The MFC Answer Book" by Eugene Kain (which is easy for me
because I have a copy sitting on my lap...) there is a whole section on
embedding (non-Wizard) property sheets in a dialog. The example
illustrations do not show the standard property sheet buttons, and I do
not see anything in the example code that removes them.
Thanks David, I will definitely need to revisit my app and most probably
replace the CTabCtrl with a CPropertySheet then!

-- David
Tom Serface
2007-12-08 21:48:56 UTC
Permalink
Hi Bob,

I think that looks great. Thanks for sharing. Did you do this with a tab
control rather than a property sheet?

Tom
Post by BobF
http://home.centurytel.net/bobf/mon.jpg
Post by David Ching
Post by BobF
If you're interested, I'll post a screenshot somewhere layer today or
tomorrow.
Sure, it would be interesting to see. I think maybe your technique would
be better suited to non-Wizard 97 compliant wizards without the banner on
top.
-- David
BobF
2007-12-09 11:59:26 UTC
Permalink
Post by Tom Serface
Hi Bob,
I think that looks great. Thanks for sharing. Did you do this with a tab
control rather than a property sheet?
Tom
CPropertySheet *is* a tabbed dialog:

<http://msdn2.microsoft.com/en-us/library/614xe086(VS.80).aspx>
Jessica
2007-12-07 05:12:01 UTC
Permalink
Thank you very much, Check, Scott and Tom!
CPropertySheet!! This is what I was looking for!!

-Jessy
Post by Jessica
Hello All,
I have to start working on a 'Wizard' which will be developed as an MFC
extension DLL for an existing MFC application.
I was thinking about how the design of the wizard should be. Currently I am
planning to create a dialog, and put all the common UI elements like Next,
Back buttons and a left pane which shows all the steps with the currently
active step highlighted in it.
Now, the main viewing area of the wizard will have to change its contents
based on which step of the wizard the user is currently in. I am planning to
put all the controls which are required in all steps in there, and show/hide
them dynamically when user clicks Next button or Back button.
MFC experts, please comment on this kind of an apporach, and also let me
know if there is a better way around to design a wizard...!
Thanks In Advance!!
Jessy
Loading...