CTreeCtrl::SetItemText

Sets the text of the item specified by hItem.

BOOL SetItemText(
   HTREEITEM hItem,
   LPCTSTR lpszItem 
);

Parameters

  • hItem
    Handle of the item whose text is to be set.

  • lpszItem
    Address of a string containing the new text for the item

Return Value

Nonzero if successful; otherwise 0.

Example

// Clear the text of the item at point myPoint.
UINT uFlags;
HTREEITEM hItem = m_TreeCtrl.HitTest(myPoint, &uFlags);

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

Requirements

Header: afxcmn.h

See Also

Concepts

CTreeCtrl Class

CTreeCtrl Members

Hierarchy Chart

CTreeCtrl::GetItemText