如何设置VB.Net ComboBox默认值

Mr *_* Ed 10 vb.net

我找不到正确的方法来使组合框中的第一项可见.

该应用程序以空组合框开头.用户选择一个单选框,然后单击Go!(多么原创).组合框通过LDAP查询加载.这一切都很好.问题是组合框仍然显示为用户为空.他们必须单击箭头才能看到选项.

用户点击Go后,如何让第一个选项"可见"?

Hei*_*nzi 23

 ' Your code filling the combobox '
 ...

 If myComboBox.Items.Count > 0 Then
     myComboBox.SelectedIndex = 0    ' The first item has index 0 '
 End If
Run Code Online (Sandbox Code Playgroud)