Ok so...(mm i think i use triple point too much xD) i'm making a simple color picker control for my App and i have 2 questions:
1) Since i couldn't write my own Hex2RGB function due to many errors :P (i tried using CByte() but couldn't get it to work properly)
so i found this code:
But the problem is that it adds a # to it and i don't want it to do so... i tried removing some parts of the code... but *****s up* the function.Code:Public Function HEXCOL2RGB(ByVal HexColor As String) As String 'The input at this point could be HexColor = "#00FF1F" Dim Red As String Dim Green As String Dim Blue As String HexColor = Replace(HexColor, "#", "") 'Here HexColor = "00FF1F" Red = Val("&H" & Mid(HexColor, 1, 2)) 'The red value is now the long version of "00" Green = Val("&H" & Mid(HexColor, 3, 2)) 'The red value is now the long version of "FF" Blue = Val("&H" & Mid(HexColor, 5, 2)) 'The red value is now the long version of "1F" HEXCOL2RGB = RGB(Red, Green, Blue) 'The output is an RGB value End Function
Can anyone help me on this or provide me with a better function??
2) My app has xp styles "installed" on it but if i make a control... when i use it will it take the style? or do i have to do something like the things you do to the application itself?
Thx in advance!!





Reply With Quote