I'm stuck and I hope someone can help me. I want to change my Enum Items name so they are displayed different in the Combobox.
Public Enum Conditions
VeryGood
Good
JustOkey
Poor
End Enum
In my Main:
ComboBox_Cond.Items.AddRange([Enum].GetNames(GetType(Conditions)))
ComboBox_Cond.DropDownStyle = ComboBoxStyle.DropDownList
ComboBox_Cond.SelectedIndex = CInt(Conditions.JustOkey)
In my combobox:
Private Sub ComboBox_Cond_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox_Cond.SelectedIndexChanged
ComboBox_Cond.Items.Add(Conditions.VeryGood).ToString("Very good")
ComboBox_Cond.Items.Add(Conditions.Good).ToString("Good")
ComboBox_Cond.Items.Add(Conditions.JustOkey).ToString("Just okey")
ComboBox_Cond.Items.Add(Conditions.Poor).ToString("Poor")
End Sub
The result of this is just as you can imagine, I got both the "raw" Enum names and the ToString names in my combobox list.
Thank you in advance!