You just draw the background + icon in CDDS_ITEMPOSTPAINT when the row is selected :
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi
How to force change list view control to highlight icon background when an item is selected in report view?
thanks
You just draw the background + icon in CDDS_ITEMPOSTPAINT when the row is selected :
See if this is worth trying:
1- Derive a class from CListCtrl.
2- Include a data member of type CButton array, with as many elements as necessary for your view.
3- Let the CButton's C++ objects be created (but not the GDI objects).
4- Override the DrawItem() virtual function.
5- Every first time this override is called for each view's element, you, then, create the GDI object for this specific element (see 6 and 7).
6- Use the CListCtrl's window as CButton's parent window.
7- Once created never more let it be recreated.
8- Deal with button's click inside each CButton class.
--please don't forget to upvote
and Accept
as answer if the reply is helpful--