[Webinar] Streamline your web hosting managementRegister Today


I can't display simple dialog on screen - HELP!!

Posted on 1999-11-08
Medium Priority
Last Modified: 2013-11-20
All I want to do is display a simple dialog on screen and add a property page which handles tabs click messages using MFC in CV++ 6.

Here I am after the code as I had enough trying to figure out myself.

I did not realise VC++ was this hard, I mean I am a VB person and it is simply heaven to program it (But of course, you know the limitations)  

Thank you all

Question by:gbzhhu
  • 3
  • 2
LVL 23

Expert Comment

ID: 2192637
Creating a full application using the CPropertySheet

Update: Creating a full application using the CPropertySheet
LVL 12

Author Comment

ID: 2196727

I have been to CodeGuru many times and they don't have code for VC++ 6 and I am having problems with VC++ 5 projects although I can now run them by recreating the project (very tedious).  Also their examples are not for the beginner.

I have now changed my design and think of using tab control.  i already have a dialog and a tab control on screen (looking good HURRAY!) However, the I can't put controls into the tabs as at design time I can only access tab1.

If you can help me with this I will increase the points to 50


Expert Comment

ID: 2202132

Here's a simple code snippet for getting CPropertySheet to work. Follow these steps and you are done.

a. Create two dialogs (say IDD_BRUSH_PAGE and IDD_CAPTION_PAGE). Add two classes for these dialogs CBrushPage and CCaptionPage, both derived from CPropertyPage.

b. Create a new class CLegendSheet inherited from CPropertySheet

c. Add a menu item to IDR_MAINFRAME, say IDR_VIEW_LEGEND.

d. Using Class Wizard add a message handler for this menu item.

void CMainFrame::OnViewLegend()
CLegendSheet ls ("Legend Settings");
CBrushPage   BrushPage;
CCaptionPage CaptionPage;

ls.AddPage (&BrushPage);
ls.AddPage (&CaptionPage);

if (ls.DoModal() == IDOK)
    // Your code here ....      

Include the required header files in MainFrm.cpp.

Do let me know if this is okay.

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

LVL 12

Author Comment

ID: 2205396
I have already got a working property sheet and your answer came a little late.  however, as I can't delete the question I will ask a replacement question.

Now that I have a modal property sheet displayed how do I add a button to the property sheet as it is not a resource and when I add it how do I add handlers to the button click

I will increase points to 50 if I get a working answer

LVL 12

Author Comment

ID: 2219685
Managed to add a button as well so i will give points to abhitlya
Please put a dummy answer so I can give you the points

Accepted Solution

abhitlya earned 60 total points
ID: 2221529
Here's the dummy answer as you requested!

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

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…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

590 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