Article ID: 141834 - Last Review: November 21, 2006 - Revision: 3.1 How to change the icon or the bitmap of a CListCtrl item in Visual C++This article was previously published under Q141834 NOTE: Microsoft Visual C++ NET (2002) supported both the managed code
model that is provided by the .NET Framework and the unmanaged native Windows
code model. The information in this article applies to unmanaged Visual C++
code only. On This PageSUMMARY This article shows how to change the icon or bitmap of a
CListCtrl item when it is selected. MORE INFORMATION When you initialize the CListCtrl by calling
CListCtrl::InsertItem(), you can pass in a value of I_IMAGECALLBACK for the
index of the image. This means that the system expects you to fill in the image
index when you get an LVN_GETDISPINFO notification. Inside of the handler for
LVN_GETDISPINFO, you can check if the item is selected and set the appropriate
image index. Sample CodeAPPLIES TO
| Article Translations
|

Back to the top
