String to Hex Function

Brett964
Brett964 used Ask the Experts™
on
Hi,
I need to convert a string to hex.
Here is what I am doing. I read a string from a file which contains a color in hex form, the same format that you can set color with(ie BackColor, ForeColor).  I need to be able to set the Form.BackColor Property to that color, whatever the file says it is.  Basically, I need an opposite function to Hex().

Thanks in advance!
Brett
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
how about this?

dim x as string
x="&H000000&"
me.BackColor = val(x)

x="&HFF0000&"
me.BackColor = val(x)

Author

Commented:
Works perfect!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial