开发者

How to change the dropdown value based on string value in .net winforms

i am using .net winform. based on my string it will focus the drop down value.

ex.

my dropdown have select value ..if i pass select as a value it should focus 开发者_如何学运维the select option in dropdown .


Just set the SelectedItem property.

 comboBox1.Items.Add("Apple");
 comboBox1.Items.Add("Orange");
 comboBox1.Items.Add("Banana");

 comboBox1.SelectedItem = "Orange";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜