Solved

Multiple Dialog Boxes

Posted on 2001-07-03
1
289 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 300 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

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 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