
Getting the palette color of a system color
Quote:
> How on Earth do you convert a long to a string representation in hex?
> Please don't say to convert the long to hex mathematically, because I
have
> tried that, and it does not appear to work. The color that you get back
> from Windows does not represent the mathematical value of a long, but
> rather the bit pattern in the three lowest bytes - FF FF FF, or 256
> possible values each for red, green, and blue.
I tried this on my system, and just setting the .BackColor property to the
long returned from GetSysColor worked ok:
Let's say that the sys color is 8421376 (The standard green background rgb
value)
label1.BackColor = 8421376
but if you do want to use the hex value then you can do this:
label1.BackColor = "&h" & hex(8421376)
HTH
--
Michael Cody
remove the "spam" from the address
Quote:
> How on Earth do you convert a long to a string representation in hex?
> Please don't say to convert the long to hex mathematically, because I
have
> tried that, and it does not appear to work. The color that you get back
> from Windows does not represent the mathematical value of a long, but
> rather the bit pattern in the three lowest bytes - FF FF FF, or 256
> possible values each for red, green, and blue.