Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I close a dialog after I open another?

Status
Not open for further replies.

jvff

Programmer
Apr 1, 2001
64
0
0
BR
Hello,
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? Thank you,

JVFF
 
Well, you could call a EndDialog(#); on the dialog box when the user clicks next - so, you could return a different value for each button (ie back, next, etc). What you pass as the parameter is what is returned by DoModal(); For example,

CMyDlg d;
int nSel = d.DoModal();

(when EndDialog(1) is called from the CMyDlg class or whatever)

switch(nSel)
{
case -1: //cancel
case 1: //next
case 2: //back
//... whatever
}

Then just display your next dialog and repeat.

bitwise
 
You might want to consider using Property Sheets, or Wizards... it sounds like this is what you're going for.

James (MS)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top