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

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

LVL 12
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Creating a full application using the CPropertySheet

Update: Creating a full application using the CPropertySheet
gbzhhuAuthor Commented:

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


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.

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.

gbzhhuAuthor Commented:
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

gbzhhuAuthor Commented:
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
Here's the dummy answer as you requested!

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.