DataTable dt = new DataTable();
dt.Columns.Add("Name");
dt.Columns.Add("VV");
dt.Rows.Add(new string[] { "王一", "x" });
dt.Rows.Add(new string[] { "赵一", "z" });
dt.Rows.Add(new string[] { "王二", "y" });
dt.Rows.Add(new string[] { "赵二", "w" });

this.comboBox1.DataSource = dt;
this.comboBox1.DisplayMember = "Name";
this.comboBox1.ValueMember = "VV";
this.comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems;
this.comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;

 

上面的 AutoCompleteSource 是大家应该关注的一点,具体的值有9种选择,其中8种是可以研究一下的

相关文章:

  • 2022-12-23
  • 2021-10-29
  • 2022-01-17
  • 2022-01-06
  • 2021-09-24
  • 2022-12-23
  • 2022-01-18
  • 2021-07-29
猜你喜欢
  • 2021-08-11
  • 2021-07-19
  • 2021-11-10
  • 2021-11-26
相关资源
相似解决方案