C# listbox显示问题
塔克茜丝 2020-01-11 10:25:24 定义了listitem的类
public class XMLListItem
{
public string Title
{ get; set; }
public string SN
{ get; set; } //存放其他属性(object型)
public override string ToString()
{ return Title; }
public XMLListItem(string title, string sn)
{ Title = title; SN = sn; }
}
然后
ListBox1.Items.Add(new XMLListItem("Title","SN");
在listbox上就自动显示了Title的string,那怎么让它显示sn的string?用什么方法?