Solved

Hide Dialog Box Clicking on the command button?

Posted on 2004-08-27
3
213 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
  • 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

Technology Partners: 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

Suggested Solutions

Title # Comments Views Activity
Need to retreive data from .TFS file exported by DVR 8 244
difference between String.subString() and String.subSequence() 6 273
canBalance challenge 34 105
firstChar challenge 13 135
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

696 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