• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 502
  • Last Modified:

CFontDialog in a CPropertyPage

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
habryka
Asked:
habryka
  • 2
1 Solution
 
galkinCommented:
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
 
habrykaAuthor Commented:
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
 
galkinCommented:
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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now