PRPFONT - How to Set CPropertySheet Fonts

ID: Q142170


The information in this article applies to:
  • The Microsoft Foundation Classes (MFC), used with:
    • Microsoft Visual C++, 32-bit Editions, versions 4.0, 4.1, 4.2, 5.0, 6.0


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.


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. Click the file names below to download the files:


Prpfont.exe

For more information about how to download files from the Microsoft Download Center, please visit the Download Center at the following Web address

http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.

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

Keywords : kbfile kbprg kbsample kbMFC KbUIDesign kbVC kbVC400 kbVC410 kbVC420 kbVC500 kbVC600 kbfaq
Version : winnt:4.0,4.1,4.2,5.0,6.0
Platform : winnt
Issue type :


Last Reviewed: January 12, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.