How to add a button inside CListctrl in MFC?

168 Views Asked by At

I faced a big problem. My client requests a button inside each CListctrl item.

There is an example image below.

enter image description here

I searched Google for days on this but couldn't find any helpful information.

The information I searched for was all examples of the report method. I need an implementation for View mode like the image above.

Could you please give me some example code or advice for reference?

1

There are 1 best solutions below

0
Vlad Feinstein On

First, look at it as an opportunity, NOT a problem :)

You can use custom draw to draw those buttons, then in your click handler see if the click was over one of those buttons.

Alternatively, you can create ONE single button and hide/move/show it as needed (in response to mouse move, for example).