Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

How to set a default value for a Combo Box?

$
0
0
I’m creating a Combobox dynamicly at run time, however, I don’t’ know how to set the default selected value for it!!? Thanks.



Dim MyComboBox As New ComboBox
MyComboBox.Name = “MyComboBox”
MyComboBox.DataSource = MyDefaultView
MyComboBox.DisplayMember = "ItemList"
MyComboBox.ValueMember = "ValueList"

----This line has NO effect on MyComboBox!!! ----
MyComboBox.SelectedValue = 6

MyComboBox.Location = New Point(80, 60)
Me.Controls.Add(MyComboBox)



Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>