让List Control有Check Box 和 让List Box有Check Box

让List Control有Check Box 和 让List Box有Check Box

1.让List Control有Check Box
用SetExtendedStyle方法可以设置,看代码:
(CListCtrl m_ListCtrl;)

DWORD dwStyle = m_ListCtrl.GetStyle();
dwStyle |= LVS_EX_CHECKBOXES;
m_ListCtrl.SetExtendedStyle(dwStyle);

2.让List Box有Check Box
首先,声明Control变量的时候用CCheckListBox代替CListBox。
然后,将List Box的Has Strings属性改为True;把Ower Draw属性改为Fixed。

你可能感兴趣的:(让List Control有Check Box 和 让List Box有Check Box)