Chris
2005-08-31 12:23:25 UTC
Hi
I'm trying to add a CheckBox in a column of a CListCtrl (but not for a whole
row as with LVS_EX_CHECKBOXES) using images.
Here is my code to setup the list control:
CImageList *m_pImageListCheckBoxes = new CImageList();
VERIFY(m_pImageListCheckBoxes->Create(IDB_CHECKBOXES, 16, 3, RGB(255, 0,
255)));
m_list.SetImageList(m_pImageListCheckBoxes, LVSIL_SMALL);
The checkboxes.bmp file has 3 images: nothing, checked, unchecked
Then I try to set the item in the list, the checkboxes must be in the third
column:
VERIFY(m_list.SetItem(i, 2, LVIF_IMAGE, NULL, 3, my_boolean_data?1:2,
LVIS_STATEIMAGEMASK, 0));
It runs fine but nothing is displayed in the third column. What am I missing
here?
Regards
Chris
I'm trying to add a CheckBox in a column of a CListCtrl (but not for a whole
row as with LVS_EX_CHECKBOXES) using images.
Here is my code to setup the list control:
CImageList *m_pImageListCheckBoxes = new CImageList();
VERIFY(m_pImageListCheckBoxes->Create(IDB_CHECKBOXES, 16, 3, RGB(255, 0,
255)));
m_list.SetImageList(m_pImageListCheckBoxes, LVSIL_SMALL);
The checkboxes.bmp file has 3 images: nothing, checked, unchecked
Then I try to set the item in the list, the checkboxes must be in the third
column:
VERIFY(m_list.SetItem(i, 2, LVIF_IMAGE, NULL, 3, my_boolean_data?1:2,
LVIS_STATEIMAGEMASK, 0));
It runs fine but nothing is displayed in the third column. What am I missing
here?
Regards
Chris