You need to store all data such as some structure carrying customer information, ID, whatever else in each combo box list item. The item can an object be of any type. When you need this information, you simply cast item to you type.
The only problem is: if your combo box list items are not strings, what text will be shown in the item? The question is: whatever the method
ToString
returns, so you will need to override
System.Object.ToString
in you item type. Something like that:
struct MyListItem {
public override ToString() {
return string.Format("{0}: {1}", this.name, this.id);
}
internal string Name { get { return this.name; } }
internal int Id { get { return this.id; } }
int id;
string name;
}
—SA