Skip to content

FindItem Method

Description

Finds the first item in the list box that starts with the specified string.

Syntax

Public Function FindItem( _
    ByVal IndexStart As Long, _
    ByVal String As String, _
    ByVal Exact As Boolean _
) As Long

Parameters

  • IndexStart: Index in the list box to start searching. It is the zero-based index of the item before the first item to be searched. Set to -1 to search from the beginning of the control.
  • String: The text string to search for.
  • Exact: Specifies whether to perform a search for an exact word match instead of a partial match.

Return Type

The zero-based index of the first item found; returns -1 if no match is found.

Remarks

The search performed by this method is not case-sensitive. The String parameter is a substring to compare against the text associated with the items in the list box. The search performs a partial match starting from the beginning of the text, returning the first item in the list that matches the specified substring.

See Also


Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.