现在的位置: 首页 > 综合 > 正文

CTreeCtrl的用法

2017年10月30日 ⁄ 综合 ⁄ 共 1634字 ⁄ 字号 评论关闭

Class Member

CTreeCtrl::SetImageList

CImageList* SetImageList( CImageList * pImageList, intnImageListType
);

Return Value

Pointer to the previous image list, if any; otherwise NULL.

Parameters

pImageList

Pointer to the image list to assign. If pImageList is
NULL
, all images are removed from the tree view control.

nImageListType

Type of image list to set. The image list can be one of the following values:

  • TVSIL_NORMAL   Sets the normal image list, which contains the selected and nonselected images for the tree view item.

  • TVSIL_STATE   Sets the state image list, which contains the images for tree view items that are in a user-defined state.

Remarks

Call this function to set the normal or state image list for a tree view control and redraw the control using the new images.

CTreeCtrl::GetNextItem

HTREEITEM GetNextItem( HTREEITEM hItem, UINT
nCode );

Return Value

The handle of the next item if successful; otherwise NULL.

Parameters

hItem

Handle of a tree item.

nCode

A flag indicating the type of relation to hItem. This flag can be one of the following values:

  • TVGN_CARET   Retrieves the currently selected item.

  • TVGN_CHILD   Retrieves the first child item. The hItem parameter must be
    NULL.

  • TVGN_DROPHILITE   Retrieves the item that is the target of a drag-and-drop operation.
  • TVGN_FIRSTVISIBLE   Retrieves the first visible item.
  • TVGN_NEXT   Retrieves the next sibling item.
  • TVGN_NEXTVISIBLE   Retrieves the next visible item that follows the specified item.
  • TVGN_PARENT   Retrieves the parent of the specified item.
  • TVGN_PREVIOUS   Retrieves the previous sibling item.
  • TVGN_PREVIOUSVISIBLE   Retrieves the first visible item that precedes the specified item.
  • TVGN_ROOT   Retrieves the first child item of the root item of which the specified item is a part.

Remarks

Call this function to retrieve the tree view item that has the specified relationship, indicated by the
nCode parameter, to hItem.

抱歉!评论已关闭.