Monday, 30 September 2013

c# Listbox string with attached int value

c# Listbox string with attached int value

Ok, this is hard to explain, I will try my best to be clear:
I have several hundred "string" items where each one may take you to one
of 13 different forms. Instead of doing something like:
if (string == string) goto form1
hundreds of times I was hoping to do something like the following:
The user could care less which form comes up and does not need to know,
they just click on the string object and it takes them to the correct
form.
I think it would be easy if each string object had an associated INT value
and then I go to the appropriate form instead of doing all of the string
processing and comparison.
I do not see a way to do this with listbox. Is there a different structure
I should use, or a work around to make this work with listbox?
Thanks for any help.

No comments:

Post a Comment