Default font static control
-
I'm in the middle of writing a control which will show some text. Now, if I just output the text using DrawText, my text is displayed using the default font, which is Arial bold I think. But I want to use the font that is used in a static control. This font is much smaller and not bold. I am able to use this font using CreateFont. But what if Ms decides to use a different font in a future version. This means I have to change my control to use a different font. What would be nice is if I should have a function that can determine the default font used for a static control. I looked on msdn but can't find such a function. So does anybody know if there is such a thing as GetSystemMetrics but then for fonts? Thanks Wim
-
I'm in the middle of writing a control which will show some text. Now, if I just output the text using DrawText, my text is displayed using the default font, which is Arial bold I think. But I want to use the font that is used in a static control. This font is much smaller and not bold. I am able to use this font using CreateFont. But what if Ms decides to use a different font in a future version. This means I have to change my control to use a different font. What would be nice is if I should have a function that can determine the default font used for a static control. I looked on msdn but can't find such a function. So does anybody know if there is such a thing as GetSystemMetrics but then for fonts? Thanks Wim
WTL has a ATLGetDefaultGuiFont( ) which uses ::GetStockObject( DEFAULT_GUI_FONT ). I think this might be what you are looking for. Otherwise you could always require the users of your control to do a
m_wndMyControl.SetFont( GetFont( ) );
after your control has been Create'd/Sublcass'ed, assuming m_wndMyControl is a member variable in a dialog - GetFont( ) returns the font of the dialog.
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!