2

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 Need only some rows in a CListCtrl control to have check boxes

4

1 回答 1

5

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.

于 2009-02-12T16:47:58.230 回答