Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ColorDialog.Color to HTML Color Code

Status
Not open for further replies.

CSpannos

IS-IT--Management
Mar 21, 2001
32
US
Hello,

What's the easiest way to convert a ColorDialog.Color to a HTML Color Code, like #000000 ?

Thanks!
Kosta
 
I actually searched in the help files in Visual Studio .NET and found this:

System.Drawing.ColorTranslator.ToHtml(ColorDialog1.Color).ToString

This works, but still gives you "words" for some of the common solid colors, like white, black, blue, red, etc. I think I'm going to try your way just so that I am sure to get the html color code each time.

Thanks so much!
Kosta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top