Поделиться через


CTreeCtrl::SelectSetFirstVisible

Call this function to scroll the tree view vertically so that the given item is the first visible item.

BOOL SelectSetFirstVisible(
   HTREEITEM hItem 
);

Параметры

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

Возвращаемое значение

Nonzero if successful; otherwise 0.

Заметки

The function sends a message to the window with the TVM_SELECTITEM and TVGN_FIRSTVISIBLE message parameters.

Пример

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

if ((hItem != NULL) && (TVHT_ONITEM & uFlags))
{
   m_TreeCtrl.SelectSetFirstVisible(hItem);
}

Требования

Header: afxcmn.h

См. также

Основные понятия

CTreeCtrl Class

CTreeCtrl Members

Hierarchy Chart

CTreeCtrl::Select

CTreeCtrl::SelectItem

CTreeCtrl::SelectDropTarget