我在一个组合中有几个 KeyValuePair。
this.cbEndQtr.Items.Clear();
this.cbEndQtr.Items.Add(new KeyValuePair<int, string>(1, "Test1"));
this.cbEndQtr.Items.Add(new KeyValuePair<int, string>(2, "Test2"));
通过传入键来选择的最简单方法是什么。例如这样的:
this.cbEndQtr.SelectedItem = 2;