?
Solved

CPropertySheet / Dialog problem

Posted on 2003-11-19
7
Medium Priority
?
692 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 750 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

764 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