XP alternative to "TEXTSTLYE" Aero theme class
I'm using the "TEXTSTYLE" class with OpenThemeData in Vista/Win 7 to render text elements with the appropriate emphasis (all values found on the Parts and Stat开发者_运维知识库es documentation):
- TEXT_MAININSTRUCTION for my header text
- TEXT_SECONDARYTEXT for subtitles
- TEXT_HYPERLINKTEXT for links
- TEXT_INSTRUCTION for standard text
This looks great on a machine that supports the themes, but they're not available on XP. What would be an acceptable alternative for XP that still retains the basic "Header/Subheader/Body" visual distinctions?
Generally, your code still has provide fallback for cases, when user has disabled themes specially for your program, or globally on his Windows machine.
So the solution is to just provide the fallback, using the plain old GDI functions. You may derive the font by making it a bit larger or bold or something like that. On XP, this fallback will be used always for classes not available in Luna (the Microsoft-made styles distributed with XP).
精彩评论