This documentation is archived and is not being maintained.

CListCtrl::DeleteItem 

Deletes an item from a list view control.


BOOL DeleteItem(
   int nItem 
);

Parameters

nItem

Specifies the index of the item to be deleted.

Nonzero if successful; otherwise zero.

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

int nCount = pmyListCtrl->GetItemCount();

// Delete all of the items from the list view control.
for (int i=0;i < nCount;i++)
{
   pmyListCtrl->DeleteItem(0);
}
Show: