c#   ComboBox特殊属性

comboBox1.ValueMember = "Id";  设置值  不显示的
comboBox1.DisplayMember = "Name";  设置name  显示的

Item item=new Item();

item.Id=1;

item.Name="张三";

 comboBox1.Items.Add(item);

 

public class Item

{

private string Id{get;set}

private string Name{get;set}

}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-06
  • 2021-10-08
  • 2021-05-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2020-04-17
  • 2021-07-19
  • 2022-01-17
  • 2022-03-02
相关资源
相似解决方案