

| Type | Description | |||
| Caption as Variant | A Variant expression that indicates the caption that is searched for. | |||
| ColIndex as Variant | A long expression that indicates the column's index, or a string expression that indicates the column's caption or column's key. | |||
| StartIndex as Variant | A long value that indicates the index of item from where the searching starts. | |||
| Long | A long value that indicates the index of item found. |
The following VB sample looks and selects the "Item 2":
With List1.Items
Dim i As Long
i = .FindItem("Item 2",0)
If (i >= 0) Then
.SelectItem(i) = True
End If
End With
The following C++ sample looks and selects the "Item 2":
CItems items = m_list.GetItems();
COleVariant vtMissing; vtMissing.vt = VT_ERROR;
int i = items.GetFindItem( COleVariant("Item 2"), COleVariant( long(0) ), vtMissing );
if ( i >= 0 )
items.SetSelectItem( i, TRUE );
The following VB.NET sample looks and selects the "Item 2":
With AxList1.Items
Dim i As Integer = .FindItem("Item 2", 0)
If (i >= 0) Then
.SelectItem(i) = True
End If
End With
The following C# sample looks and selects the "Item 2":
int i = axList1.Items.get_FindItem("Item 2", 0, null);
if (i >= 0)
axList1.Items.set_SelectItem(i, true);
The following VFP sample looks and selects the "Item 2":
With thisform.List1.Items
local i
i = .FindItem("Item 2",0)
If (i >= 0) Then
.SelectItem(i) = .t.
EndIf
EndWith