Finds an item, looking for Caption in ColIndex colum. The searching starts at StartIndex item.
Type | Description | |||
Value as Variant | A Variant expression that indicates the caption that is searched for. | |||
ColIndex as Variant | A string expression that indicates the column's caption, or a long expression that indicates the column's index. | |||
StartIndex as Variant | A long value that indicates the index of item from where the searching starts. | |||
HITEM | A long expression that indicates the item's handle that matches the criteria. |
Use the FindItem to search for an item. Finds a control's item that matches CellValue( Item, ColIndex ) = Caption. The StartIndex parameter indicates the index from where the searching starts. If it is missing, the searching starts from the item with the 0 index. The searching is case sensitive only if the ASCIIUpper property is empty. Use the AutoSearch property to enable incremental search feature within the column. The FindBar method looks for the item that hosts a specified bar.
The following VB sample selects the first item that matches "DUMON" on the first column:
G2antt1.Items.SelectItem(G2antt1.Items.FindItem("DUMON", 0)) = True
The following C++ sample finds and selects an item:
#include "Items.h" CItems items = m_g2antt.GetItems(); COleVariant vtMissing; long hFind = items.GetFindItem( COleVariant("King"), COleVariant("LastName"), vtMissing ); if ( hFind != NULL ) items.SetSelectItem( hFind, TRUE );
The following C# sample finds and selects an item:
axG2antt1.Items.set_SelectItem(axG2antt1.Items.get_FindItem("Child 2", 0, 0), true);
The following VB.NET sample finds and selects an item:
With AxG2antt1.Items Dim iFind As Integer iFind = .FindItem("Child 2", 0) If Not (iFind = 0) Then .SelectItem(iFind) = True End If End With
The following VFP sample finds and selects an item:
with thisform.G2antt1.Items .DefaultItem = .FindItem("Child 2",0) if ( .DefaultItem <> 0 ) .SelectItem( 0 ) = .t. endif endwith