Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

Rated
Read 22,877 times

Related Categories

VB Express Color Object to Hex String - Code

ckanoab

Code

This function takes a color object and returns the Hex value with a preceeding #.

Private Function ColorHex( ByVal color As Color) As String
        Dim r As String = Hex(FColor.R), G As String = Hex(FColor.G), B As String = Hex(FColor.B)
        If r.Length = 1 Then r = 0 & r : If G.Length = 1 Then G = 0 & G : If B.Length = 1 Then B = 0 & B
        ColorHex = "#" & r & G & B
End Function

Comments