Share via


CTreeCtrl Class

Provides the functionality of the Windows common tree view control.

class CTreeCtrl : public CWnd

Members

Public Constructors

Name

Description

CTreeCtrl::CTreeCtrl

Constructs a CTreeCtrl object.

Public Methods

Name

Description

CTreeCtrl::Create

Creates a tree view control and attaches it to a CTreeCtrl object.

CTreeCtrl::CreateDragImage

Creates a dragging bitmap for the specified tree view item.

CTreeCtrl::CreateEx

Creates a tree control with the specified Windows extended styles and attaches it to a CTreeCtrl object.

CTreeCtrl::DeleteAllItems

Deletes all items in a tree view control.

CTreeCtrl::DeleteItem

Deletes a new item in a tree view control.

CTreeCtrl::EditLabel

Edits a specified tree view item in-place.

CTreeCtrl::EndEditLabelNow

Cancels the edit operation on the label of a tree-view item in the current tree-view control.

CTreeCtrl::EnsureVisible

Ensures that a tree view item is visible in its tree view control.

CTreeCtrl::Expand

Expands, or collapses, the child items of the specified tree view item.

CTreeCtrl::GetBkColor

Retrieves the current background color of the control.

CTreeCtrl::GetCheck

Retrieves the check state of a tree control item.

CTreeCtrl::GetChildItem

Retrieves the child of a specified tree view item.

CTreeCtrl::GetCount

Retrieves the number of tree items associated with a tree view control.

CTreeCtrl::GetDropHilightItem

Retrieves the target of a drag-and-drop operation.

CTreeCtrl::GetEditControl

Retrieves the handle of the edit control used to edit the specified tree view item.

CTreeCtrl::GetExtendedStyle

Retrieves the extended styles that the current tree-view control is using.

CTreeCtrl::GetFirstVisibleItem

Retrieves the first visible item of the specified tree view item.

CTreeCtrl::GetImageList

Retrieves the handle of the image list associated with a tree view control.

CTreeCtrl::GetIndent

Retrieves the offset (in pixels) of a tree view item from its parent.

CTreeCtrl::GetInsertMarkColor

Retrieves the color used to draw the insertion mark for the tree view.

CTreeCtrl::GetItem

Retrieves the attributes of a specified tree view item.

CTreeCtrl::GetItemData

Returns the 32-bit application-specific value associated with an item.

CTreeCtrl::GetItemExpandedImageIndex

Retrieves the index of the image to display when the specified item of the current tree-view control is in the expanded state.

CTreeCtrl::GetItemHeight

Retrieves the current height of the tree view items.

CTreeCtrl::GetItemImage

Retrieves the images associated with an item.

CTreeCtrl::GetItemPartRect

Retrieves the bounding rectangle for a specified part of a specified item in the current tree-view control.

CTreeCtrl::GetItemRect

Retrieves the bounding rectangle of a tree view item.

CTreeCtrl::GetItemState

Returns the state of an item.

CTreeCtrl::GetItemStateEx

Retrieves the extended state of the specified item in the current tree-view control.

CTreeCtrl::GetItemText

Returns the text of an item.

CTreeCtrl::GetLastVisibleItem

Retrieves the last expanded item in the current tree-view control.

CTreeCtrl::GetLineColor

Retrieves the current line color for the tree view control.

CTreeCtrl::GetNextItem

Retrieves the next tree view item that matches a specified relationship.

CTreeCtrl::GetNextSiblingItem

Retrieves the next sibling of the specified tree view item.

CTreeCtrl::GetNextVisibleItem

Retrieves the next visible item of the specified tree view item.

CTreeCtrl::GetParentItem

Retrieves the parent of the specified tree view item.

CTreeCtrl::GetPrevSiblingItem

Retrieves the previous sibling of the specified tree view item.

CTreeCtrl::GetPrevVisibleItem

Retrieves the previous visible item of the specified tree view item.

CTreeCtrl::GetRootItem

Retrieves the root of the specified tree view item.

CTreeCtrl::GetScrollTime

Retrieves the maximum scroll time for the tree view control.

CTreeCtrl::GetSelectedCount

Retrieves the number of selected items in the current tree-view control.

CTreeCtrl::GetSelectedItem

Retrieves the currently selected tree view item.

CTreeCtrl::GetTextColor

Retrieves the current text color of the control.

CTreeCtrl::GetToolTips

Retrieves the handle to the child ToolTip control used by a tree view control.

CTreeCtrl::GetVisibleCount

Retrieves the number of visible tree items associated with a tree view control.

CTreeCtrl::HitTest

Returns the current position of the cursor related to the CTreeCtrl object.

CTreeCtrl::InsertItem

Inserts a new item in a tree view control.

CTreeCtrl::ItemHasChildren

Returns nonzero if the specified item has child items.

CTreeCtrl::MapAccIdToItem

Maps the specified accessibility identifier to the handle to a tree-view item in the current tree-view control.

CTreeCtrl::MapItemToAccID

Maps the specified handle to a tree-view item in the current tree-view control to an accessibility identifier.

CTreeCtrl::Select

Selects, scrolls into view, or redraws a specified tree view item.

CTreeCtrl::SelectDropTarget

Redraws the tree item as the target of a drag-and-drop operation.

CTreeCtrl::SelectItem

Selects a specified tree view item.

CTreeCtrl::SelectSetFirstVisible

Selects a specified tree view item as the first visible item.

CTreeCtrl::SetAutoscrollInfo

Sets the autoscroll rate of the current tree-view control.

CTreeCtrl::SetBkColor

Sets the background color of the control.

CTreeCtrl::SetCheck

Sets the check state of a tree control item.

CTreeCtrl::SetExtendedStyle

Sets the extended styles for the current tree-view control.

CTreeCtrl::SetImageList

Sets the handle of the image list associated with a tree view control.

CTreeCtrl::SetIndent

Sets the offset (in pixels) of a tree view item from its parent.

CTreeCtrl::SetInsertMark

Sets the insertion mark in a tree view control.

CTreeCtrl::SetInsertMarkColor

Sets the color used to draw the insertion mark for the tree view.

CTreeCtrl::SetItem

Sets the attributes of a specified tree view item.

CTreeCtrl::SetItemData

Sets the 32-bit application-specific value associated with an item.

CTreeCtrl::SetItemExpandedImageIndex

Sets the index of the image to display when the specified item of the current tree-view control is in the expanded state.

CTreeCtrl::SetItemHeight

Sets the height of the tree view items.

CTreeCtrl::SetItemImage

Associates images with an item.

CTreeCtrl::SetItemState

Sets the state of an item.

CTreeCtrl::SetItemStateEx

Sets the extended state of the specified item in the current tree-view control.

CTreeCtrl::SetItemText

Sets the text of an item.

CTreeCtrl::SetLineColor

Sets the current line color for the tree view control.

CTreeCtrl::SetScrollTime

Sets the maximum scroll time for the tree view control.

CTreeCtrl::SetTextColor

Sets the text color of the control.

CTreeCtrl::SetToolTips

Sets a tree view control's child ToolTip control.

CTreeCtrl::ShowInfoTip

Displays the infotip for the specified item in the current tree-view control.

CTreeCtrl::SortChildren

Sorts the children of a given parent item.

CTreeCtrl::SortChildrenCB

Sorts the children of a given parent item using an application-defined sort function.

Remarks

A "tree view control" is a window that displays a hierarchical list of items, such as the headings in a document, the entries in an index, or the files and directories on a disk. Each item consists of a label and an optional bitmapped image, and each item can have a list of subitems associated with it. By clicking an item, the user can expand and collapse the associated list of subitems.

This control (and therefore the CTreeCtrl class) is available only to programs running under Windows 98 and Windows NT version 4 and later.

For more information on using CTreeCtrl, see:

Inheritance Hierarchy

CObject

CCmdTarget

CWnd

CTreeCtrl

Requirements

Header: afxcmn.h

See Also

Reference

CWnd Class

Hierarchy Chart

CImageList Class

Concepts

MFC Sample CMNCTRL1