Export (0) Print
Expand All
MFC
Expand Minimize
1 out of 4 rated this helpful - Rate this topic

CTreeCtrl::SetItemImage 

Associates images with an item.


BOOL SetItemImage(
   HTREEITEM hItem,
   int nImage,
   int nSelectedImage 
);

Parameters

hItem

Handle of the item whose image is to be set.

nImage

Index of the item's image in the tree view control's image list.

nSelectedImage

Index of the item's selected image in the tree view control's image list.

Nonzero if successful; otherwise 0.

Each item in a tree view control can have a pair of bitmapped images associated with it. The images appear on the left side of an item's label. 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.

Call this function to set the index of the item's image and its selected image within the tree view control's image list.

For more information on images, see CImageList.

See the example for CTreeCtrl::GetItemImage.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.