views:

101

answers:

2

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...

A: 

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

Nick Brooks
That assumes they haven't changed the default theme. Which is likely, as most people don't, but still... it's not as elegant as the current System.Drawing.SystemColors way.
Yadyn
A: 

You are aware of these two properties I presume?

Philip Wallace