Solved

Hide Dialog Box Clicking on the command button?

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Folder Comparison 12 54
Perl Awk Need Help 3 116
iSeries DB2 Query 2 95
Dell Alienware Graphics Amplifier Driver for non-Alienware systems 18 249
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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…

785 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