![]() ![]() | ||
You're trying to bend over backwards to make your program user-friendly and have let the user add items to the main combo box. But now you need to see if they've added a particular item to the combo box—how do you find out how many items there are in the combo box currently so you can set up your loop?
No problem; you can get the number of items in a combo box with the Items.Count property like this:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("The combo box contains " & ComboBox1.Items.Count & " items.")
End Sub
![]() ![]() | ||