CTreeCtrl::SelectItem

BOOL SelectItem( HTREEITEM hItem );

Return Value

Nonzero if successful; otherwise 0.

Parameters

hItem

Handle of a tree item.

Remarks

Call this function to select the given tree view item. If hItem is NULL, then this function selects no item.

Example

// The pointer to my tree control.
extern CTreeCtrl* pmyTreeCtrl;
// The point to test.
extern CPoint myPoint;

// Select the item that is at the point myPoint.
UINT uFlags;
HTREEITEM hItem = pmyTreeCtrl->HitTest(myPoint, &uFlags);

if ((hItem != NULL) && (TVHT_ONITEM & uFlags))
{
   pmyTreeCtrl->SelectItem(hItem);
}

CTreeCtrl OverviewClass MembersHierarchy Chart

See Also   CTreeCtrl::Select, CTreeCtrl::GetSelectedItem, CTreeCtrl::SelectDropTarget