Share via



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


      CImageList* SetImageList(
   CImageList * pImageList,
   int nImageListType 


  • 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. You must use this state for overlay images.

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

Return Value

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


See the example for CTreeCtrl::GetImageList.


Header: afxcmn.h

See Also

CTreeCtrl Class
Hierarchy Chart
CImageList Class