I wanted to know how to alphabetize 2 listboxes together. lstResult contains Names and lstResult2 contains numbers corrisponding to the names in lstResult. When alphabetizing, i want to keep the name in lstResult and number in lstResult2 together.
Happy Newyear to you all!
My first approach (perhaps not the best one) would be:
Put your two listboxes in a Dictionary, something like this:
Dictionary<string, int> d = new Dictionary<string, int>();
Now sort your first listbox. Walk through it item by item and fill the second listbox with the number you find after shearching the name in the dictionary.
Alternatively you could sort the dictionary and fill both listboxes.