Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

buttons on a dialog to open another dialog

Status
Not open for further replies.

haktekvc

Technical User
Dec 30, 2000
17
GB
I have made an MFC exe and i want to make a button that the user clicks on to open another dialog
for example a user clicks on a button with caption 'About'
and it the opens an about box

Thanks for any help
 
Add a button control in your dialog box. Create the new child dialog that u want to open.. say call it CMyDialog.

For the button that u just added, place the following code for the event "On_ButtonLClick"....

CMyDialog dlg.
dlg.DoModal ();

This will open the child dialog.

Sriks
 
the method by sriks creates a modal dialog box. well if thats ur need, you need not read further ;-)

in case you have to create a modeless dialog, you can use the create function, supplying the DialogID as a parameter... additionally you may have to set the focus to the child dialog (others: is this really necessary??)

and remember, in both cases, you have to include the header file of your Dialog class ( say MyDialog.h ) appropriately...

Thanks,
sgopinath
 
Thanx Sgopinath and striks it really helped

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top