CSDN博客

img henryzc

Setting or removing an image for an CListCtrl item

发表于2004/7/2 16:09:00  988人阅读

分类:

Rating: none

Zafir Anjum (view profile)
August 6, 1998


The image for an item can be set when an item is first added to the list view control.
m_listctrl.InsertItem( LVIF_TEXT | LVIF_IMAGE, nRow, sItemText, 0, 0, nImage, NULL);
The image can later be changed by calling the SetItem() function. The CListCtrl class does not have a SetImage() function.
m_listctrl.SetItem( 0, 0, LVIF_IMAGE, NULL, nImage, 0, 0, 0 );
To remove the image, use a value of -1 for nImage, else nImage should be a zero based index of the image in the image list.
0 0

相关博文

我的热门文章

img
取 消
img