»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
|
Check if a given color hexadecimal is trueThis function checks if a entered color value is a textBox is in a valid hexadecimal format
''' CheckTextBoxColor("#ffffff") returns true
Private Function CheckTextBoxColor(ByVal value As String) As Boolean
If value <> String.Empty Then
If Not value.Length = 7 Then
Return False
End If
If Not value.StartsWith("#") Then
Return False
End If
Dim temp As String = value.Substring(1, 6)
Try
Int("&H" & temp)
Return True
Catch ex As Exception
Return False
End Try
End If
End Function |
|