?
Solved

Showing and Hiding MFC Dialogs...

Posted on 2003-02-24
7
Medium Priority
?
244 Views
Last Modified: 2013-11-25
Hello, I am a Visual Basic Programmer that is making a long overdue switch to Visual C++...

I need to know how to switch between 2 dialog boxes...

I created a base application using the MFCAppWizard.

For example, in Visual Basic, I would do the commands:
frmForm1.Hide
frmForm2.Show

Is there something similar I can do in Visual C++?
0
Comment
Question by:deadlyfluvirus
  • 4
  • 2
7 Comments
 

Expert Comment

by:kusamson
ID: 8012763
try this:  assuming your dialog boxes' names are frmFrom1, frmForm2

frmForm1.ShowWindow(SW_HIDE);
frmForm2.ShowWindow(SH_SHOW);
0
 

Expert Comment

by:zfact
ID: 8014124
Hi deadlyfluvirus,
Send me your E-Mail Id and i will send you a sample application.

Thanks & Regards
Zfact
0
 

Author Comment

by:deadlyfluvirus
ID: 8025661
zfact,
  Please do.  send to chrisnuss@maplenet.net  Thanks
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:deadlyfluvirus
ID: 8035853
Kusamson,
  I am unable to get that to work.  Should I be using me a class name for the form?  I'm a little lost...
0
 

Accepted Solution

by:
kusamson earned 200 total points
ID: 8036253
Create the 2 dialogs with resource editor.  
If you open Class wizard, you should get prompted to add a new class for each dialog you created in the editor.
Follow the wizard and create your new classes, which should have CDialog as base class.

you now should have 2 classes, for instance:
class CMyDialog1 : public CDialog
class CMyDialog2 : public CDialog

You can use these classes like you usually do, for example:
CMyDialog1 frmForm1;
frmForm1.DoModal();

CMyDialog2 frmForm2;
frmForm2.DoModal();

(ps. code is not necessary in this order, you want to put it where you would like to create your dialog)

then you can show or hide the dialog by using
frmForm1.ShowWindow(SW_HIDE);
frmForm2.ShowWindow(SW_SHOW);
0
 

Author Comment

by:deadlyfluvirus
ID: 8036276
Great response time!  Thanks Alot!
0
 

Author Comment

by:deadlyfluvirus
ID: 8042110
zfact, Did you send the sample code yet?  Please send it again to this different email address: chrisnuss@chrisnuss.com
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

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: 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…
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 is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

621 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