I've already solved this in my own way, but I thought I'd ask if there was a real simple way to handle this problem that I maybe didn't think of (maybe though the controls?):
Let's say, I have a ComboBox (or a ListBox or anything of that nature), which I want to show the user in a sorted fashion with some strings in it. The catch is, what I want to load are strings that have no relationship to the data that those strings represent in the program/system.
So, to establish the relationship between each of the items, I can establish a TStringList and place my real items in that, and my "friendly" list of items into the ComboBox the user sees in a one-to-one relationship. Like:
Friendly1 ---> Real1
Friendly2 ---> Real2
etc.
Now, I want to show the strings in the "friendly" list in a sorted fashion. I can set Sorted to true, but that does nothing to preserve the relationship in the other list.
So, is there an easier way to solve it than to physically do the sort, as I did?
Let's say, I have a ComboBox (or a ListBox or anything of that nature), which I want to show the user in a sorted fashion with some strings in it. The catch is, what I want to load are strings that have no relationship to the data that those strings represent in the program/system.
So, to establish the relationship between each of the items, I can establish a TStringList and place my real items in that, and my "friendly" list of items into the ComboBox the user sees in a one-to-one relationship. Like:
Friendly1 ---> Real1
Friendly2 ---> Real2
etc.
Now, I want to show the strings in the "friendly" list in a sorted fashion. I can set Sorted to true, but that does nothing to preserve the relationship in the other list.
So, is there an easier way to solve it than to physically do the sort, as I did?