This thread is for discussions of VB Express Color Object to Hex String.
In VB Express can you not use
Imports System.Drawing.ColorTranslator
Then just code
txtHtmlName.Text = ToHtml(cPreview.BackColor)
txtHtmlName.Text = Drawing.ColorTranslator.ToHtml(cPreview.BackColor)
Back to a color
cPreview.BackColor = Drawing.ColorTranslator.FromHtml(txtHtmlName.Text)
There are lots of color functions but I had to spend a lot of time finding good examples
Like
Imports System.Drawing.Color
cPreview.BackColor = FromArgb(c.Red, c.Green, c.Blue)
Just thought I would share these
David
Yes, that gives you am html compatible string, or if you want the Hex version just do:
"#" + System.Drawing.ColorTranslator.ToOle(System.Drawing.Color.Green).ToString("X6")