MFC中ListControl 怎么清空所有Item

2024-12-04 23:36:48
推荐回答(2个)
回答1:

CListCtrl::DeleteAllItems
BOOLDeleteAllItems();
Return Value
Nonzero if successful; otherwise zero.

Example
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;

// Delete all of the items from the list view control.
pmyListCtrl->DeleteAllItems();
ASSERT(pmyListCtrl->GetItemCount() == 0);

回答2:

CListCtrl:DeleteAllItems()