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
Solved

CPropertySheet / Dialog problem

Posted on 2003-11-19
7
682 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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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 Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

809 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