CTreeCtrl::SelectSetFirstVisible

BOOL SelectSetFirstVisible( HTREEITEM hItem );

Return Value

Nonzero if successful; otherwise 0.

Parameters

hItem

Handle of the tree item to be set as the first visible item.

Remarks

Call this function to scroll the tree view vertically so that the given item is the first visible item. The function sends a message to the window with the TVM_SELECTITEM and TVGN_FIRSTVISIBLE message parameters.

Example

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

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

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

CTreeCtrl OverviewClass MembersHierarchy Chart

See Also   CTreeCtrl::Select, CTreeCtrl::SelectItem, CTreeCtrl::SelectDropTarget