Freigeben über


CTreeCtrl::GetPrevSiblingItem

Call this function to retrieve the previous sibling of hItem.

HTREEITEM GetPrevSiblingItem(
   HTREEITEM hItem 
) const;

Parameters

  • hItem
    Handle of a tree item.

Return Value

The handle of the previous sibling; otherwise NULL.

Example

HTREEITEM hmyItem = m_TreeCtrl.GetSelectedItem();

// Show all of the previous siblings of hmyItem in bold.
HTREEITEM hItem = hmyItem;

while (hItem != NULL)
{
   m_TreeCtrl.SetItemState(hItem, TVIS_BOLD, TVIS_BOLD);
   hItem = m_TreeCtrl.GetPrevSiblingItem(hItem);
}

Requirements

Header: afxcmn.h

See Also

Reference

CTreeCtrl Class

Hierarchy Chart

CTreeCtrl::GetNextSiblingItem

CTreeCtrl::GetParentItem

CTreeCtrl::GetChildItem

Other Resources

CTreeCtrl Members