Freigeben über


CTreeCtrl::GetImageList

Call this function to retrieve the handle of the normal or state image list associated with the tree view control.

CImageList* GetImageList( 
   UINT nImageList  
) const;

Parameters

  • nImageList
    Type of image list to retrieve. The image list can be one of the following values:

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

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

Return Value

Pointer to the control's image list if successful; otherwise NULL.

Remarks

Each item in a tree view control can have a pair of bitmapped images associated with it. One image is displayed when the item is selected, and the other is displayed when the item is not selected. For example, an item might display an open folder when it is selected and a closed folder when it is not selected.

For more information on image lists, see the CImageList class.

Example

ASSERT(m_TreeCtrl.GetImageList(TVSIL_NORMAL) == NULL);

m_TreeCtrl.SetImageList(&m_TreeImages, TVSIL_NORMAL);
ASSERT(m_TreeCtrl.GetImageList(TVSIL_NORMAL) == &m_TreeImages);

Requirements

Header: afxcmn.h

See Also

Reference

CTreeCtrl Class

Hierarchy Chart

CImageList Class

CTreeCtrl::SetImageList