Solved

How can I make a button open a dialog?

Posted on 2000-05-05
4
217 Views
Last Modified: 2010-04-02
I'm trying to make a dialog based app, but I don't know how to get a button (A button like the OK button) to open up a dialog that I've made. For example, since there isn't any Menu in a dialog based app I can't get the ABOUTBOX dialog to show up. How would I make a button that says "About" open up the About Dialog?

Thanx
0
Comment
Question by:klutch555
  • 2
4 Comments
 
LVL 3

Accepted Solution

by:
Shay050799 earned 65 total points
ID: 2780412
out a new button on the dialog
in class wizard, set an event to WM_CLICK

and do the following:
CAboutDlg dlg;
dlg.DoModal()

that will lunch ur dialog as modal dialog, means u have to dismiss this dialog in order to get back to the one that lunched it

Shay
0
 

Expert Comment

by:JohnPhelps
ID: 2780983
I am not sure which compiler you are using, but in the handler for a button that is on your main form you could activate any other dialog.

Either using WM_CLICK (As shown above) or using the OnClick event etc.

If you expand a little on your environment, I can help you more.
0
 

Expert Comment

by:JohnPhelps
ID: 2780987
I am not sure which compiler you are using, but in the handler for a button that is on your main form you could activate any other dialog.

Either using WM_CLICK (As shown above) or using the OnClick event etc.

If you expand a little on your environment, I can help you more.
0
 

Author Comment

by:klutch555
ID: 2790423
I'm using Windows 95, Visual C++ 6.0 Standard. I'm making a MFC DIalog Based program. And becuase the dialog based programs don't have menus, I have to make buttons to open new dialogs (Acually, I just want to).

I made a project named LiPHiM, MFC Dialog based, and I want to add a button on the main dialog to open another dialog. How would I do this? I'm new to C++, so please explain as well as you can.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

770 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