Can you use Hex color code in VB
Printable View
Can you use Hex color code in VB
Yep, you can indeedy.
Just use &H?, where ? is the hex digit.
Code:Me.BackColor = &HF
I think RGB() is much easier method to secify color code ;)
:p Kinjal :p
I use the code from the properties window - select your color (or custom color), copy the code, and declare a constant of the color name equal to the color code.
Then, if you want something to be LightYellow, just say CommandButton1.backcolor=LightYellow.