This is a simple way of finding the html color code for any color, this can be very usefull to find a colours code quickly and efficently
First create a standard form and place the following objects on it;
a textbox named; text1
a button named; command1
and a common dialog control called 'colordlg'
Finally, put the following code in the command1_Click event
Private Sub Command1_Click()
colordlg.ShowColor
Dim Col As String, SootyR As String, SootyG As String, SootyB As String
Col = Hex(colordlg.Color)
Do Until Len(Col) = 6
Col = 0 & Col
Loop
SootyR = Mid(Col, 1, 2)
SootyG = Mid(Col, 3, 2)
SootyB = Mid(Col, 5, 2)
Text1.Text = Chr(34) & "#" & SootyB & SootyG & SootyR & Chr(34)
End Sub
Comments