开发者

Is it possible to use theme colors in Windows Forms apps?

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开发者_C百科 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...


I know that this is a stupid idea but you could check the OS version and then preload a set of colours


You are aware of these two properties I presume?

  • LinkLabel.ActiveLinkColor Property
  • LinkLabel.VisitedLinkColor Property
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜