Microsoft KB Archive/142170

= Prpfont.exe sample demonstrates how to set the desired font for your CPropertyPages in Visual C++ =

Article ID: 142170

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 4.0 Standard Edition

 Microsoft Visual C++ 4.1 Subscription

 Microsoft Visual C++ 4.2 Enterprise Edition

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul>

 Microsoft Visual C++ .NET 2002 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q142170

<div class="notice_section">

Note Microsoft Visual C++ NET (2002) supported both the managed code model that is provided by the .NET Framework and the unmanaged native Windows code model. The information in this article applies to unmanaged Visual C++ code only.

<div class="summary_section">

SUMMARY
PRPFONT shows how to set the desired font for your CPropertyPages in the Resource Editor, and at run-time, set the sheet's font to be the same and size everything correctly. All of this is done in a class called CMySheet. A function called ChangeDialogFont does the work of setting the font and resizing windows. CPropertySheet::BuildPropPageArray was overridden so that the fonts in the pages are not reset.

<div class="moreinformation_section">

MORE INFORMATION
In versions of Visual C++ earlier than 4.0, MFC had its own implementation of CPropertySheet. You could set the font for your CPropertySheet by setting the font of your first CPropertyPage dialog box resource in the Resource Editor. At run time, the sheet would use the font that you set and size everything according to the font. Starting with Visual C++ 4.0, MFC uses the Windows 95 PropertySheet control. This control will always use the system font for the sheet. This is by design. MFC will also force the pages to use the same font as the sheet. This is done in a function called BuildPropPageArray. Because this is an undocumented function, it may change or be deleted in future versions of MFC.

CMySheet will use the font of the first active CPropertyPage to set the font and size of the CPropertySheet and its child windows. The CPropertyPages will appear with the font specified in the resource editor.

The following files are available for download from the Microsoft Download Center:

Prpfont.exe

For more information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.

Additional query words: 4.10 4.20 prpfont propfont runtime run-time

Keywords: kbhowto kbfile kbfont kbgdi kbprogramming kbpropsheet kbsample kbuidesign KB142170

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.