Skip to content

FindItem Method

Description

Finds and returns a reference to a ListViewItem object in a ListView control.

Syntax

Public Function FindItem( _
    ByVal [sz] As String, _
    Optional ByVal [Where] As Variant, _
    Optional ByVal [Index] As Variant, _
    Optional ByVal [fPartial] As Variant _
) As [ListViewItem](XtremeSuiteControls~ListViewItem.md)

Parameters

  • sz
    A string expression indicating the ListItem object to be found.

  • Where
    A flag from the ListViewFindItemWhere enumeration specifying whether the string will be matched to the ListViewItem object's Text, Subitems, or Tag property, as described in Settings.

  • xtpListViewText: Matches the string with a ListViewItem object's Text property.

  • xtpListViewSubItem: Matches the string with any string in a ListViewItem object's SubItems property.

  • xtpListViewTag: Matches the string with any ListViewItem object's Tag property.

  • Index
    An integer or string that uniquely identifies a member of an object collection and specifies the location from which to begin the search. The integer is the value of the Index property; the string is the value of the Key property. If no index is specified, the default is 1.

  • fPartial
    An integer or constant specifying that a match will occur if the item's Text property is the same as the string, as described in Settings.

  • 0: An integer or constant specifying that a match will occur if the item's Text property begins with the whole word being searched. Ignored if the criteria is not text.

  • 1: An integer or constant specifying that a match will occur if the item's Text property begins with the string being searched. Ignored if the criteria is not text.

Return Type

Returns a reference to a ListViewItem object in a ListView control.

Remarks

If you specify Text as the search criteria, you can use fPartial so that a match occurs when the ListViewItem object's Text property begins with the string you are searching for.

See Also


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