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";
精彩评论