Rating:
none
The image for an item can be set when an item is first added to the list view control.
| 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.
The image can later be changed by calling the SetItem() function. The CListCtrl class does not have a SetImage() function.m_listctrl.InsertItem( LVIF_TEXT | LVIF_IMAGE, nRow, sItemText, 0, 0, nImage, NULL);
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.m_listctrl.SetItem( 0, 0, LVIF_IMAGE, NULL, nImage, 0, 0, 0 );
博客介绍了在ListView控件中设置和修改图像的方法。添加项时可设置图像,使用InsertItem函数;之后可通过SetItem函数修改图像。CListCtrl类无SetImage函数。移除图像时,nImage设为 -1,否则为图像列表中图像的从零开始的索引。
4万+

被折叠的 条评论
为什么被折叠?



