-
July 28th, 2015, 06:51 AM
#1
Correct way of getting theme font for child controls?
The edit, button, static, listbox, and combobox controls all have that old system-looking font in them by default, even when using visual styles.
What is the correct way of getting or creating a font for these controls that respects the current theme?
I tried GetThemeSysFont with TMT_CAPTIONFONT and TMT_SMALLCAPTIONFONT but they both return the same font for every control, which is identical to the main window caption and too big for these controls. Should I simply take this font and decrease the size or is there some other method I should know about?
-
July 28th, 2015, 08:05 AM
#2
Re: Correct way of getting theme font for child controls?
GetStockObject function
DEFAULT_GUI_FONT
Remarks
It is not recommended that you employ this method to obtain the current font used by dialogs and windows. Instead, use the SystemParametersInfo function with the SPI_GETNONCLIENTMETRICS parameter to retrieve the current font. SystemParametersInfo will take into account the current theme and provides font information for captions, menus, and message dialogs.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|