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
Solved

Hide Dialog Box Clicking on the command button?

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Detect CR LF to each line 12 170
pre4 challenge 19 103
sumHeights2  challenge 7 115
Annoying "thing" blocks my view 4 115
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

856 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