Forcing dialogs to use a certain font
Posted on 1998-08-04
I would like to use a specific font in all of my dialog boxes. The reason this is important to me is that I want to avoid the problem associated with dialog box layout when users choose "large fonts" in the display control panel.
When my application starts up, I create a font with the following code:
s_DefaultFont = CFont::FromHandle((HFONT) GetStockObject(DEFAULT_GUI_FONT));
fontStruct.lfHeight = -11;
fontStruct.lfWeight = 400;
s_DefaultFont = new CFont;
I then call SetFont on all of the controls I put in my dialog boxes. However, this font seems to get overridden when I test my application under "Large Fonts". Can you tell me how I can force all my application's dialogs to use the font I created above? Or, do you have a better solution to the large font problem?