I need some advice.
Here is my scenareo.
I have a form displayed where a user can can select a 'function' from a list box. That 'function' has a corresponding ID number which I need to be able to take and use later in the code.
The List of functions is preset (about 150+ them and the IDs are already assigned (so I can't just use the index).
So if the user selects "Function A", I need the code to set a variable to, for example "42" (or whatever that Funtion's ID is).
I was going to do this using listbox.item and listbox.itemData, but I'm using VB.Net in VS2008 and I understand that function is no longer present (to add ItemData at design time).
Here's where it gets complicated. When the form loads it looks at the variable containing the FunctionID and if there is one present, I want it to populate the co-ordinating FunctionName. I can do that if I know the index number, but I don't know how to look at the FunctionID and return it's index (all FunctionIDs are unique).
I'm looking for some advice on the best way to:
A) store the info, either in the Listbox using ItemData, in an array (but I'd prefer to do it at design time), or some other way you might suggest.
B) cross-reference the ID and display the name in the listbox when the form loads.
Sorry this is so long, but I figured it would be easier if you had some background