?
Solved

Multiple Dialog Boxes

Posted on 2001-07-03
1
Medium Priority
?
290 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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. …
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.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

765 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