?
Solved

Showing and Hiding MFC Dialogs...

Posted on 2003-02-24
7
Medium Priority
?
234 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
[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
  • 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
Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

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…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…

765 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