I have an enumeration in the form:
Public Enum MyCollections As Integer
My_Stuff = 0
My_Things = 1
End Enum
I would like to use these as values in a ComboBox, but I would like to display the strings “My Stuff” and “My Things” respectively.
I’m sure I’ve seen a method for quickly creating some kind of local object definition where I can assign a string property to be displayed, and a “MyCollections” type property to store the value of the enum element, but I can’t for the life of me think of how to explain that to a search engine.
Can anyone interpet my vague memories into some code I can use to set a DataSource for my ComboBox and retrieve the data when a user changes the selection?
Right, it looks as though I was thinking of “anonymous types”. Here’s some code that answer the (vary, very vague) question I as trying to ask: