property Items.FindPath (Path as String) as HITEM

Finds an item given its path.

TypeDescription
Path as String A string expression that indicates the item's path.
HITEM A long expression that indicates the item's handle that matches the criteria.

The FindPath property searches the item on the column SearchColumnIndex.  Use the FullPath property in order to get the item's path. Use the FindItem to search for an item. 

The following VB sample selects the item based on its path: 

G2antt1.Items.SelectItem(G2antt1.Items.FindPath("Files and Folders\Hidden Files and Folders\Do not show hidden files and folder")) = True

The following C++ sample selects the item based on its path:

#include "Items.h"
CItems items = m_g2antt.GetItems();
COleVariant vtMissing;
long hFind = items.GetFindPath( "Files and Folders\\Hidden Files and Folders\\Do not show hidden files and folder" );
if ( hFind != NULL )
	items.SetSelectItem( hFind, TRUE );

The following VB.NET sample selects the item based on its path:

With AxG2antt1.Items
    Dim iFind As Integer
    iFind = .FindPath("Files and Folders\Hidden Files and Folders\Do not show hidden files and folder")
    If Not (iFind = 0) Then
        .SelectItem(iFind) = True
    End If
End With

The following C# sample selects the item based on its path:

int iFind = axG2antt1.Items.get_FindPath("Files and Folders\\Hidden Files and Folders\\Do not show hidden files and folder");
if ( iFind != 0 )
	axG2antt1.Items.set_SelectItem(iFind, true);

The following VFP sample selects the item based on its path:

with thisform.G2antt1.Items
	.DefaultItem = .FindPath("Files and Folders\Hidden Files and Folders\Do not show hidden files and folder")
	if ( .DefaultItem <> 0 )
		.SelectItem( 0 ) = .t.
	endif
endwith