Solved

Hide Dialog Box Clicking on the command button?

Posted on 2004-08-27
3
215 Views
Last Modified: 2013-11-20
Hi  all
I would like to explain my question.
I insert three dialog box(d1,d2 and d3) and also make their classes for each dialog box(CD1,CD2 and CD3), derived from CDialog.d1 contains two button "Back and Next".On Clicking on the "Next" button, it calls d2(second dialog box).d2 also contains two button "Continue and Cancel".Again I press the "Continue" button, it calls d3(third dialog box).
Now I want to do that when I click on "Continue" button,it calls d3 and dismiss(hide) the both dialog box(d1 and d2)simultaneously.

I wrote code something like that:

void CD1::OnNext()
{
CD2 dlg2;
dlg2.DoModal();
}
............
..............
void CD2::OnContinue()
{
CD3 dlg3;
dlg3.DoModal();
..............................................
...................................

}

Please help me
How to write code on the "Coninue" button so that d1 and d2 will be hide together?.

Please Excuse my bad writting for i have a poor way of writting

Regards
Rajesh
0
Comment
Question by:RAJESH SHARMA
[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
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
SteH earned 20 total points
ID: 11910914
A way to achieve it without too many modifications would be:

void CD2::OnContinue()
{
CD3 dlg3;
ShowWindow (SW_HIDE); // hide d2
CWnd* pWnd = GetParent (); // parent should be d1;
pEWnd->ShowWindow (SW_HIDE); // and hide it.
dlg3.DoModal(); // and now display the third one.
..............................................
...................................

}
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 11911093
Have you looked at a property sheet in wizard mode?  I suspect this is what you are trying to code by hand.
0
 
LVL 13

Expert Comment

by:SteH
ID: 11911592
Thx for the points. I wrote it between the lines what AndyAinscow spoke out loud: Consider a different approach like property sheets, a tabbed dialog with sub-dialogs for these tasks.
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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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 video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…

707 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