tags:

views:

806

answers:

1

I have a CListCtrl with checkboxes. I want to be able to disable one of the items so that the user cannot click the checkbox. Is this possible? If so, how?

Edit: Found the specifics on how to hide a checkbox in another question http://stackoverflow.com/questions/190667

+3  A: 

Shortly: Not easily possible.

You'll need to sub-class the CListCtrl and implement this behavior on your own or download for example the MFC Grid Control that allows you to do that.

As for the removing check-boxes idea, yes, that might be possible, MSDN:

Version 4.70. Enables check boxes for items in a list-view control. When set to this style, the control creates and sets a state image list with two images using DrawFrameControl. State image 1 is the unchecked box, and state image 2 is the checked box. Setting the state image to zero removes the check box.

arul