Enum
Public Enum ECouleur
Rouge
Bleu
Jaune
Vert
Orange
Noir
End Enum
VB.NET
Dim couleurs As String() = [Enum].GetNames(GetType(ECouleur))
For Each couleur As String In couleurs
MonComboBox.Items.Add(New ListItem(StringUtils.FromCamelCase(couleur), couleur))
Next
Public Shared Function FromCamelCase(ByVal camelCase As String) As String
If camelCase Is Nothing Then
Throw New ArgumentException("Valeur Null, non autorisé")
End If
Dim sb As New StringBuilder(camelCase.Length + 10)
Dim first As Boolean = True
Dim lastChar As Char = ControlChars.NullChar
For Each ch As Char In camelCase
If Not first AndAlso (Char.IsUpper(ch) OrElse Char.IsDigit(ch) AndAlso Not Char.IsDigit(lastChar)) Then
sb.Append(" "c)
End If
sb.Append(ch)
first = False
lastChar = ch
Next
Return sb.ToString()
End Function