Dr. GUI: Are You a Font Wizard?
Boy, I hope the Doc can help me. I'm developing a Windows 95 application using the MFC classes and Visual C++ 4.0. The application is an MDI. I have a Property Sheet dialogor actually a wizardthat consists of four property pages. I've set the font on the pages to Times New Roman, but when the wizard shows up the correct font is not displayed. Can you help?
Do I get a T-shirt?
S. Nadeem Akhtar
Dr. GUI isn't a font wizard, but he referred your chart to a specialist who is.
Prior to MFC 4.0, MFC had its own implementation of property sheets. You could set the font of the dialog box templates of your property pages in the Resource Editor, and at run time, the sheet would use the same font.
Starting with Visual C++ 4.0, MFC uses the property sheet control that comes with the operating system. This control will always set the sheet to use the system font. MFC also ensures that fonts in your property pages match the font used for the property sheet. This is by design.
To change the font of the sheet and its pages, you need to call SetFont for each window (including all child windows) and resize everything accordingly. This can be a daunting task. Fortunately, there's a sample in the Microsoft Knowledge Base that shows us how to do this. The sample file is called PRPFONT.EXE and can be downloaded from FTP.MICROSOFT.COM. For more information on this sample and instructions on downloading it, you can access the article, Q142170PRPFONT - "How to Set CPropertySheet Fonts." The sample includes a class derived from CPropertySheet called CMySheet. This class does the work of setting fonts and resizing windows according to what is set for the dialog box template of the first page.