Setting or removing an image for an item


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.
 



Comments

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Learn about the state of the nation of Dell EMC Data Protection. What are the current Data Protection challenges our customers are facing? What are the unique benefits of the Dell EMC Data Protection solution? How do we assist our customers and partners with their effort to Modernize, Automate, and Transform their IT environments through efficient and innovative solutions? The discussion will cover protecting virtual environments, cloud based applications, and how to gain the efficiencies of cloud storage for …

  • The need for swift digital transformation is leading to broader utilization of hybrid IT infrastructure by financial services organizations. Banks, investment firms and insurance companies continue to leverage a mix of premises-based and cloud–based technology infrastructure to dramatically improve operational performance, and are networking distributed resources to create business value. Read this white paper to learn why having the right network resources in place is key to benefiting from the cost, …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date