Happy Codings - Programming Code Examples
Html Css Web Design Sample Codes CPlusPlus Programming Sample Codes JavaScript Programming Sample Codes C Programming Sample Codes CSharp Programming Sample Codes Java Programming Sample Codes Php Programming Sample Codes Visual Basic Programming Sample Codes


Visual Basic Programming Code Examples

Visual Basic > Graphics Games Programming Code Examples

RGB Long Splitter Sub

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
RGB Long Splitter Sub Public Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long Public Sub LongToRGB(ByVal RGBColor As Long, ByRef RColor As Integer, _ ByRef GColor As Integer, ByRef BColor As Integer) HexRGB = Hex(RGBColor) If Left$(HexRGB, 2) = "80" And Len(HexRGB) > 6 Then HexRGB = _ Hex(GetSysColor(Val("&H" &Right$(HexRGB, 2)))) t = String$(6 - Len(HexRGB), Asc("0")) & HexRGB RColor = Val("&H" & Mid$(t, 5, 2)) GColor = Val("&H" & Mid$(t, 3, 2)) BColor = Val("&H" & Mid$(t, 1, 2)) End Sub