110,536
社区成员
发帖
与我相关
我的任务
分享
/// <summary>
/// Combox 里面添加 描述 和 ID 键值对
/// </summary>
public class ComBoxItem
{
private int _RealValue = -1;
private string _DisplayText = "";
public string DisplayText
{
get
{
return _DisplayText;
}
set
{
_DisplayText = value;
}
}
public int RealValue
{
get
{
return _RealValue;
}
set
{
_RealValue = value;
}
}
public ComBoxItem()
{
}
public ComBoxItem(string ShowText, int RealVal)
{
_DisplayText = ShowText;
_RealValue = RealVal;
}
public override string ToString()
{
return _DisplayText.ToString();
}
}
ComBoxItem selitem = (ComBoxItem)this.comboBox2father.SelectedItem;
tempmodel.FatheroriginsID = selitem.RealValue;