Matthew ".NET 247" Reynolds

Matthew Reynolds... software development consultant, author, speaker and trainer

ControlPaint.LightLight

I found this the other day and didn't have a chance to blog it at the time.

Imagine you're building a control and you want the developer to be able to specify the colour of some element on it (imagine something like a progress bar that shows a percentage value), but you want to accent other drawing elements of that controls in subtlely different colours.  For example, you might want to let the developer say that he/she wants a “RoyalBlue” progress bar, but to make it look a little nicer you want to use a graduated fill from a light blue to the blue he/she specifiies.

System.Windows.Forms.ControlPaint has a number of methods that let you get slightly different colours from a seed colour.  They are, and the name explains it all: DarkDark, Dark, Light and LightLight.

Comments

Phil Scott said:

Wow, very cool. I never knew about that. Time to abuse gradients even more!
# November 21, 2003 10:06 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)