Link to home
Start Free TrialLog in
Avatar of RIAS
RIASFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Find the index of the listbox item

Hello,
How to find the index of the item in the listbox.

Dim items = From i In lstbox.Items Where i.ToString().StartsWith("Al")

        If items.Count > 0 Then

        Else

        End If

Open in new window

Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Something like this I think is what you are asking for.  indx is the index of the string s in the listbox items
indx = listbox.Items.IndexOf(s)
Avatar of RIAS

ASKER

Thanks.
In code provided can you suggest on how to find the index of the item.
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RIAS

ASKER

Thanks Andy!