i want to make a labels background color white using the hex(FFFFFF) of rgb colors, how can i do that?
i need to make it in the code, not change the color of it on the design i need it to be editable..
Printable View
i want to make a labels background color white using the hex(FFFFFF) of rgb colors, how can i do that?
i need to make it in the code, not change the color of it on the design i need it to be editable..
Have your tried: Label1.BackColor=&HFFFFFF ? Precede hex with &H
You can also do it the easy way withCode:Label1.Backcolor = vbWhite
i dont need that but i need to use the hex colors... please?
LaVolpe showed you how, what problems are you having with it?
oh, i didnt see his post, sorry. i'll try and edit when i've tried.
EDIT:
worked and thank you everyone that helper/and-posted.
EDIT:
if you know how about RGB?
Regarding your last edited comment...
With the exception of system colors which are negative values in VB (i.e., vbButtonFace), valid colors can be almost any format. Though most system colors can be used for vb controls, they cannot be used in APIs that expect color values.
For example, White:
1. vbWhite
2. &HFFFFFF
3. RGB(255,255,255) .... vb's RGB() function
4. 16777215
If you ever need to know the color value of a system color:Code:Private Declare Function OleTranslateColor Lib "oleaut32.dll" (ByVal ColorIn As Long, ByVal hPal As Long, ByRef RGBColorOut As Long) As Long
' Translate system color into its resulting color value
Public Function SystemColorRGB(plngSystemColor As Long) As Long
Const S_OK = &H0
Dim lngReturn As Long
If OleTranslateColor(plngSystemColor, 0, lngReturn) = S_OK Then SystemColorRGB = lngReturn Else lngReturn = -1
End Function
if you try to calculate the rgp color there is no way.
you should know what each rgp code mean.