資源簡介
msdn說: DisplayMember is set to the comboBox control, it uses the default ToString of the object,
代碼片段和文件信息
public?class?Person
{
????public?int?Id?{?get;?set;?}
????public?string?Name?{?get;?set;?}
????public?string?Lastname?{?get;?set;?}
????public?override?string?ToString()
????{
????????return?String.Format(“{0}?{1}“?Name?Lastname);
????}
}
private?void?button2_Click(object?sender?EventArgs?e)
{
???? var?people?=?LoadSamplePeople();
//.DisplayMember?is?set?to?the?comboBox?control?it?uses?the?default?ToString?of?t
- 上一篇:C# 支付寶在線支付(即時到賬接口)
- 下一篇:Web模擬登錄 講解
評論
共有 條評論