Matthew ".NET 247" Reynolds

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

November 2003 - Posts

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.

SMTP authentication through System.Web.Mail

G Andrew Duthie has a post about how to authenticate yourself to an outbound SMTP server when using the SmtpMail class.

It's an issue of plugging the right values into the Fields collection on the object. 

More Posts