public struct MyItem
{
public string Name;
public string Tag;
public override string ToString()
{
return Name;
}
}
MyItem item;
item.Name= "张三 ";
item.Tag= "aaa ";
//添加
ListBox1.Items.add((Object)item);
//....
//取出
MyItem theItem=(MyItem)ListBox1.SelectedItem;
if (theItem.Tag== "aaa ")
{
//....
}