Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含世界上所有国家的组合框。我的问题是如何在程序启动时在组合框中显示“英格兰”。
我知道我可以使用下面的代码获取一个国家/地区的索引,但不知道如何显示所选国家/地区。
int index = cmbCountry.Items.IndexOf(address.Country);
cmbCountry.SelectedIndex = index;
cmbCountry.SelectedValue = "England";