Solved

CFontDialog in a CPropertyPage

Posted on 1997-12-08
3
423 Views
Last Modified: 2013-11-20
I need to insert a common dialog (CFontDialog) into a property page (CPropertyPage). The font dialog should be displayed on a property page, but user should choose OK, Cancel and Apply buttons from property sheet (CPropertySheet) - not from CFontDialog.
I DON'T want to build my own font dialog and create the property page from template - it HAVE TO be this one defined as common dialog in Windows.
It'n not neccessary to use directly CFontDialog - maybe there is another way to use common dialogs?
0
Comment
Question by:habryka
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 200 total points
ID: 1311768
Font picture and color property pages are wrapped by internal MFC classes CFontPropPage, CPicturePropPage and CColorPropPage. All these classes are derived from base class CStockPropPage which is in turn derived from COlePropertyPage. You can find CFontPropPage class in ctlimpl.h and fontprop.cpp. To embedd this page in Property sheet you can create page as Property sheet child window and then hide Ok and Apply buttons. When user cliks Ok or Apply buttons on Property sheet you should call IPropertyPage::Apply.
0
 

Author Comment

by:habryka
ID: 1311769
I found these classes and files, but what exactly should I do: include ctlimpl.h as a header and use CFontPropPage instead CPropertyPage (or perhaps derive my own class from CFontPropPage)?
Or should I only use definition of CFontPropPage as an example.
My goal is to create this property page this way, so that when Microsoft changes something in common font dialog, it should change also in my application. In other words this font property page should always look the same as the common font dialog in other windows applications.
Maybe you have some piece of code to solve my problem?
0
 
LVL 7

Expert Comment

by:galkin
ID: 1311770
Unfortunally, I have never implemented this myself but I can use CFontPropPage instead of one of the pages in your property sheet. Yes template itself is in OLE DLLs so you should not worry about its change when using this class.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 98
method notes when mouse over in eclipse 5 68
dog bark java program 15 82
Making an alias 7 52
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 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

20 Experts available now in Live!

Get 1:1 Help Now