Changes

Color Constants / Color Forms / Controls / Transparency VB6

644 bytes added, 19:33, 10 February 2008
/* All Possible Ways */
The following lines were added (+) and removed (-):
   cmd(0).BackColor = &HFF&      ' Red1. In HEX, BLUE is first, Green, then Red, the reverse of RGB (actually BGR) is the default VB method   cmd(1).BackColor = &HFF00&    ' Green   cmd(0).BackColor = &HFF&      ' Red   / &H0000FF&   cmd(2).BackColor = &HFF0000  ' Blue   cmd(1).BackColor = &HFF00&    ' Green / &H00FF00&   cmd(2).BackColor = &HFF0000  ' Blue / &HFF0000&2. Decimal RGB value3. Using VB Color Constants=== Convert RGB Hex (like used in HTML) to VB Hex ===Code Sample: Public Function h2v(wHex As String) As Long  Dim strTmp As String  wHex = Trim("" & wHex)  If Len(wHex) = 7 Then    If Left(wHex, 1) = "#" Then wHex = Right(wHex, 6)  End If  If Len(wHex) = 6 Then    strTmp = "&H" & Right(wHex, 2) & Mid(wHex, 3, 2) & Left(wHex, 2) & "&"  Else    strTmp = "&H000000&"  End If  h2v = Val(strTmp)  Debug.Print h2v End Function
Bureaucrat, administrator
16,192
edits