Solved

CFontDialog in a CPropertyPage

Posted on 1997-12-08
3
438 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

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
not able to insert into temp table 68 156
either24  challenge 19 90
modThree challenge 4 77
mapBully challenge 6 113
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

912 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

15 Experts available now in Live!

Get 1:1 Help Now