Solved

CPropertySheet / Dialog problem

Posted on 2003-11-19
7
680 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Define unique primary key 9 94
Use of condition with 'serial' in ansible 2 62
unix example issues 18 91
Trying to run powershell  in a batch file. How do I do this? 8 92
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

831 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