Solved

CPropertySheet / Dialog problem

Posted on 2003-11-19
7
674 Views
Last Modified: 2013-11-20
Hi All,

I have a CDialog with all its controlls.
I have a CDialog (now derived from CPropertySheet) to which I add CDialogs (now derived from CPropertyPage)

This is fine if I want to keep my normal dialogs and tabbed application spearate. I however want to put a Tabbed control with property sheets on the buottom half of my dialog.

Can this be done? Would this be done with CPropertySheet ?

Any suggestions?

Peter

0
Comment
Question by:Pete2003
7 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 9779112
http://www.codeguru.com/controls/CMyTabCtrl.html

Use tab control on the bottom half of your dialog and add other controls you need to the top half.
0
 
LVL 13

Accepted Solution

by:
SteH earned 250 total points
ID: 9779143
You can add a property sheet to a dialog. No problem. -Property uses always default dlg fond independent of the font chosen for your dlg.
And you can use a Tab Control as well. -More work for showing/hiding pages.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9779151
You can put a tab control onto your dialog and show/hide child dialogs depending on what is selected in the tab.

eg in your InitInstance of the dialog
m_pDlgPage1 = new CDlgPage1();
m_pDlgPage1->Create(...)
m_pDlgPage1->SetWindowPos(NULL, left, top, right, bottom, SWP_SHOWWINDOW | SWP_NOZORDER);

m_pDlgPage2 = new CDlgPage2();
m_pDlgPage2->Create(...)
m_pDlgPage2->SetWindowPos(NULL, left, top, right, bottom, SWP_HIDEWINDOW | SWP_NOZORDER);

I use this technique for having dialogs display complex information dynamically based on user options (radio button / combo box)

I haven't tried doing this directly with a PropertySheet that contains pages - I suspect you would have problems with moving between controls with the tab key for instance.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:Pete2003
ID: 9779522
SteH: how exactly do you add a property sheet to a dialog. There is no control you can add on ... or do you actually create the control in runtime ?
0
 
LVL 13

Expert Comment

by:SteH
ID: 9779649
Have a look at the article on Codeguru
http://www.codeguru.com/propertysheet/inside_dialog.shtml
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 9779650
You create the dialog at runtime. Read the codeguru article, it should describe all the steps necessary.

Basically, you create a picture control on your CDialog as a place holder for your property sheet. At runtime, you then retrieve the size and position of the place holder and use this information to place and size the property sheet.

Be aware of the potential problems that the font isssue SteH mentioned can cause. If you are not using the default font on your property sheet, the prop sheet contents may not look like they do in your resource editor. If e.g. you translate your application to Japanese, and use the MS Shell Dlg 2 font, your property sheet will be stretched in horizontal, and compressed in vertical direction. This will potentially result in your property sheet to be truncated. This used to be a problem with stand alone property sheets as well, but was fixed in VS6SP4.
0
 

Author Comment

by:Pete2003
ID: 9785220
Ok my question was if I would need to use it not how, but I guess this also answers mine thxs. There wan't be any font issues as they all in the same font.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Tab names are off by one 5 49
notReplace  challenge 53 102
Hibernate methods 2 58
zeroMAx challenge 20 77
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: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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 video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now