Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Colour Help!

104| Sat, 01 Dec 2007 23:22:00 GMT| alex_read| Comments (2)
Hi all!

I've got a nifty tool that grabs rgb colours, I've ended up with a value "#628262", what I need to do is convert that to one of those funny &H00HDDFFC& type numbers so I can shove it into the backcolour property of my form.

Are there any tools out there to do that one please?

Keywords & Tags: colour, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/80741/
 
«« Prev - Next »» 2 helpful answers below.
Looks like a HTML colour? They're already in hex so just put the value in the following:

Public Function HexToLong(ByVal HexData As String) As Long

HexToLong = Val("&H" & Trim$(HexData))

End Function

or replace the # with &H e.g.

Private Const MyBackground = &H628262&

merrioncomputin | Mon, 03 Dec 2007 21:44:00 GMT |

why dont you just use
[Highlight=VB]
text1.backcolor = RGB(XX, XX, XX)
[Highlight=VB]
??

johntindell | Mon, 03 Dec 2007 21:45:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories