I added string items to an array then tried to do a for loop to count the number of items so I could add the items to a combobox
This is what I have...
I guess I could do this like this but I still want to know how to count that array if possible
vbMarkO
This is what I have...
Visual Basic:
Dim licArr() As String = {"Item1", "Item2", "Item3" -
"Item4", "Item5", "Item6"}
' Now I want to count the number of items added to this array
For i As Integer = 0 To licArr.Count - 1 ' However there is no .Count available
' It wont let me do this WHY?
' and how can I get this done?
' WHat I hope to do is this
cboLicense.Items.Add(licArr(i))
Next
So what am I doing wrong... why isnt their a .count option for this string array?
I guess I could do this like this but I still want to know how to count that array if possible
Visual Basic:
For i As Integer = 0 To 4
cboLicense.Items.Add(licArr(i)) ' This will work fine I know but
' but I was wondering how I might make it doing a count incase I need to add
' more Items later
Next
vbMarkO
Last edited: