Retrieves the index of a specified object in the collection, or -1 if not found.
Searches for the specified Object and returns the zero-based index of the first occurrence within the entire collection.
Visual Basic (Usage) | Copy Code |
---|---|
|
Parameters
- value
-
The object to locate in the list.
The Object to locate in the collection.
Return Value
An integer value that represents the index of the item in the collection.
The zero-based index of the first occurrence of value within the entire collection, if found; otherwise, -1.
Negative one (-1) will be returned if item is not found.
Note that you can also use the GetIndex method, which takes a string (the object name) as an argument.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family