Solved

CPropertySheet / Dialog problem

Posted on 2003-11-19
7
676 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 110
repeatSeparator  java  challenge 13 56
sameEnds challenge 3 133
Execute multiple curl cmds with sleep and send output to file 10 88
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

947 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

18 Experts available now in Live!

Get 1:1 Help Now