Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Multiple Dialog Boxes

Posted on 2001-07-03
1
Medium Priority
?
292 Views
Last Modified: 2013-11-20
I would like to create an application in which the user initially encounters a dialog box to input information.  Upon selecting a "Next Screen" button on the interface, I would like the user to be directed to another dialog box that also allows user input.

I'm currently reading a book, however, that states for dialog based projects....

"There is only one dialog box window and all the available controls ususally are initially visible.  There are no hidden dialog boxes or menu items, and the user can usually see exactly which operations should be carried out."

Does anyone know a way in which a button on a particular dialog box can be used to call another dialog box?  Some sample code would be REALLY helpful. Thanks so much!!!
0
Comment
Question by:cneaton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 49

Accepted Solution

by:
DanRollins earned 600 total points
ID: 6249888
In the Dialog editor, create a dialog box named Main.  In it put a button named "Advanced."  Also create another dlg box named Advanced Settings (make its ID IDD_Advanced).  Double-click the title baar of each dialog box and let the ClassWizard create code for both dialogs.  Let's say they are named CDlgMain and CDlgAdvanced.

Now, back in the Main dialg, double-click the button named advanced.  The Class Wizard will generate code for a handler, named, probably CDlgMain::OnAdvanced() and will put your cursor there.

Now add code like this:

void CDlgMain::OnAdvanced()
{
   CDlgAdvanced dlg;
   dlg.m_sTextVar= "some initial value";
   int nRet= dlg.DoModal();
   if (nRet == IDOK ) {
       // save the modified values to a file or something
   }
}

-==-=-=-=-=-=-=-=-=-
as to the quote:
>> "There is only one dialog box window and all the available ...should be carried out."

I've read it several times and it does not make any sense.  You can have a dialog that has a button that opens another dialog that has a button that opens another dialog... as deeply as you want to go (however, a good UI will rarely go more than teo levels deep).

-==-=-=-=-=-=-=-=-=-
On re-reading your question, it begins to sound as if you want to create what is called a "Wizard" -- A series of dialog boxes in which the user clicks [Next] and [Previous].  Is that what you want?  If so, use the CPropertyPage class.

-- Dan

P.S.  This sounds a lot like another clueless question that I fielded recently.  Is this homework?

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question