listbox.setSelected where value matches array

DannyT

Freshman
Joined
Apr 14, 2005
Messages
36
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 from a dataset.

I want to select all the items in my listbox where the items value is in my array.

I can't seem to figure out the right syntax.

I currently have
Code:
For Each anItem In lstMachineStatus.Items
    If anItem.Item("query_id") = arrMachineStatus(n) Then
        'how do i get the listboxes index of anItem to place in below?
        lstMachineStatus.SetSelected(SOMETHINGHERE, True)
    End If
Next

any help much appreciated
 
Back
Top