Поделиться через


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;

Параметры

  • 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.

Возвращаемое значение

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

Заметки

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.

Пример

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

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

Требования

Header: afxcmn.h

См. также

Основные понятия

CTreeCtrl Class

CTreeCtrl Members

Hierarchy Chart

CImageList Class

CTreeCtrl::SetImageList