DannyTmoov2
IS-IT--Management
I have an array of values that match some of the values (as in valueMember not displayMember) within a multi-select listbox bound to a datatable.
I want to select all the items in my listbox where the value is in my array.
I can't seem to figure out the right syntax.
I currently have
but index is always returning as -1
any help much appreciated
I want to select all the items in my listbox where the value is in my array.
I can't seem to figure out the right syntax.
I currently have
Code:
Dim index As Integer
For n = 0 To UBound(arrMachineStatus)
index = ListBox1.Items.IndexOf(arrMachineStatus(n))
If index > -1 Then
ListBox1.SetSelected(index, True)
End If
Next n
but index is always returning as -1
any help much appreciated