View Single Post
  #2 (permalink)  
Old 06-28-2009, 4:45 PM
InertiaM InertiaM is offline
VB.NET Forum Idol
.NET Framework: .NET 2.0
 
Join Date: Nov 2007
Location: Kent, UK
Age: 39
Posts: 527
Reputation: 168
InertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to ask
Default

Code:
        Dim colorNames As String() = [Enum].GetNames(GetType(KnownColor))
        For Each colorName As String In colorNames
            Dim _knownColor As KnownColor = DirectCast([Enum].Parse(GetType(KnownColor), colorName), KnownColor)
            If _knownColor > KnownColor.Transparent AndAlso _knownColor < KnownColor.ButtonFace Then
                ComboBox1.Items.Add(colorName)
            End If
        Next
__________________
Always parameterize your queries - read more here
Reply With Quote