|
-
Dec 19th, 2008, 08:12 AM
#1
Thread Starter
Fanatic Member
[RESOLVED] Colors
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..
-
Dec 19th, 2008, 08:36 AM
#2
Re: Colors
Have your tried: Label1.BackColor=&HFFFFFF ? Precede hex with &H
-
Dec 19th, 2008, 08:48 AM
#3
Re: Colors
You can also do it the easy way with
Code:
Label1.Backcolor = vbWhite
-
Dec 19th, 2008, 11:41 AM
#4
Thread Starter
Fanatic Member
Re: Colors
i dont need that but i need to use the hex colors... please?
-
Dec 19th, 2008, 12:23 PM
#5
Re: Colors
LaVolpe showed you how, what problems are you having with it?
-
Dec 19th, 2008, 12:44 PM
#6
Thread Starter
Fanatic Member
Re: Colors
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?
Last edited by Justa Lol; Dec 19th, 2008 at 12:51 PM.
-
Dec 19th, 2008, 03:51 PM
#7
Re: [RESOLVED] Colors
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
-
Dec 19th, 2008, 04:57 PM
#8
Re: [RESOLVED] Colors
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
-
Dec 21st, 2008, 04:33 PM
#9
Addicted Member
Re: [RESOLVED] Colors
if you try to calculate the rgp color there is no way.
you should know what each rgp code mean.
IT CTO & System Administrator.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|