Is it possible to use theme colors in Windows Forms apps?
Posted
by Yadyn
on Stack Overflow
See other posts from Stack Overflow
or by Yadyn
Published on 2009-11-16T22:15:15Z
Indexed on
2010/03/30
13:03 UTC
Read the original article
Hit count: 494
I normally make use of System Colors whenever possible when designing Windows Forms applications just so that it'll fit in with the user's preferences. But is it possible to use Theme Colors?
I realize that this limits you in several ways (must be running Windows that supports it and has the Themes service running), so I would certainly like it if it could fall back on some other default, but since I'm fairly sure 99% of my users will have it available, I'd like to make use of it if possible.
Specifically, for newer Windows versions (Vista and 7), things like hyperlinks have a softer more pastel-ish blue. The old System Colors do not define anything for links and the like, and in general are much more limited (coming from the 95 days) in choices and variety.
Though WPF probably has better support, I'm not at liberty to use it. If some third party utility, assembly, or the like is necessary, it would also need to be free to use. I don't need anything that fancy, but in a perfect world I would be able to do something like this:
linkLabel1.LinkColor = System.Drawing.ThemeColors.Hyperlink;
Am I stuck just using the default Blue (0,0,255) and having them look out of place in Vista and above? I'll even settle for ugly p/invoke interop methods if need be...
© Stack Overflow or respective owner