Link to home
Start Free TrialLog in
Avatar of uma99
uma99

asked on

back,next and cancel

       I am trying to create a program that takes steps. How can I, when the user clicks the "Next >" button it opens another dialog and closes the one just used? And
when the user clicks the "Back >" button it opens previous dialog and closes the one just used? And cancel
would close all dialogs?
Avatar of DanRollins
DanRollins
Flag of United States of America image

What you want is called a "Wizard."  MFC supports this a a special case of what is called a CPropertySheet.  Real all about it:

http://msdn.microsoft.com/library/en-us/vcmfc98/html/_mfc_cpropertysheet.asp
and
http://msdn.microsoft.com/library/en-us/vccore98/HTML/_core_property_sheets.asp

In particular, you will need to call SetWizardMode() before calling DoModal();

-- Dan

ASKER CERTIFIED SOLUTION
Avatar of Shielsy
Shielsy

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
Avatar of uma99
uma99

ASKER

Hi Shielsey
I looked at you answer it is fine if i am using just  3 or 4 dialogs but my apllication has 10 dialogs. You can view my apllication to be somewhat similar to those dialogs when ur installing an application.First of it has a splash screen then it asks the user to select options and later it stores the opetions in a drive an d somethinglike  that.'
Thank you if can suggest a remedy for this case.
but anyway i will try to use the one proposed by you.i am not sure of using base calss .so i will try to  use it thank you.
uma
You should use a Wizard-style PropertySheet.  It is designed to do *exactly* what you want to do.  Did you read my post?  Do you need additional details?

-- Dan
Avatar of uma99

ASKER

Dan,
can youplease give me those aditonal details  . iam a new bie i do n ot know anything about property sheet and also i wnat to ask how to close all dialogs when you clickk on X
button.'
thaank you
It really is quite simple.  Please read:

  http://msdn.microsoft.com/library/en-us/vccore98/HTML/_core_property_sheets.asp

which explains it in detail and provides examples.  It boils down to...

CDlgPgWelcome pgWelcome; // a dlg box, but derived from CPropertyPage
CDlgPgStep1   pgStep1;  // also
CDlgPgStep2   pgStep2;  // also

CPropertySheet cSheet("ABC Install Wizard");

cSheet.AddPage( &pgWelcome );
cSheet.AddPage( &pgStep1 );
cSheet.AddPage( &pgStep2 );
cSheet.SetWizardMode();

int nRet= cSheet.DoModal();
if (nRet== IDOK ) {
   the user did not cancel from the wizard
   ...etc...
}

This is a 50-point question that has already been locked, so I expect you to do a bit of research on your own.

-- Dan
Avatar of uma99

ASKER

Thank you Dan and Shielsy
The pleasure is all mine.  I guess.

-- Dan