CCheckListCtrl - A Listview Control with a checkbox in any column
If you want to add a checkbox to a CListCtrl you only have to add the LVS_EX_CHECKBOXES style.
Unfortunately this only works for the first column. You could however change the column order to get around this problem, but this also moves the item icon to the other column.
The class presented in this article uses owner drawn to get around these problems.
The usage is very simple just set the item text to “boolean” and the CCheckListCtrl draws a checkbox:

m_ListCtrl.SetItemText(2, 2, "boolean");
m_ListCtrl.SetCheck(2, FALSE);

Check out the full example to see the class in use.

Download example executable

Download source code
This class is part of the Pablo Software Solutions MFC Extension Package - Controls Edition


[Home] [Products] [Source Code] [Downloads] [Support]

© 2015 - Pablo Software Solutions
All rights reserved.