另外--
ListView_SetExtendedListViewStyle(m_ListCtrl, LVS_EX_CHECKBOXES);
可以,但是还想问一句点Item时,checkbox可以选中吗?how to?
ListView_SetExtendedListViewStyle(m_ListCtrl, LVS_EX_CHECKBOXES);
可以,但是还想问一句点Item时,checkbox可以选中吗?how to?
Over-ride OnInitDialog() in your dialog box and subclass the list box that you created in your resource file. Set the style of the check box as you wish. See the documentation provided with your compiler. m_CheckListBox.SubclassDlgItem(IDC_CHECKLISTBOX, this);
m_CheckListBox.SetCheckStyle(BS_AUTOCHECKBOX);
Since CCheckListBox is derived from CListBox, you have access to all the class members of CListBox. Add strings to the list box using AddString() as follows. m_CheckListBox.AddString("Test String");
CCheckListBox provides several class members that allow you to access or set the check state of the items in the list box. For example, to see whether the first item in the list box is checked (the index of the first item would be zero), use GetCheck(). int iIndex = 0;
int iState;
iState = m_CheckListBox.GetCheck(iIndex);