法1.for(int nIndex=0;nIndex<m_List.GetHeaderCtrl()->GetItemCount();nIndex++)
m_List.DeleteColumn(0);
法2.Example
// The pointer to my list view control.
extern CListCtrl* pmyListCtrl;
int nColumnCount = pmyListCtrl->GetHeaderCtrl()->GetItemCount();
// Delete all of the columns.
for (int i=0;i < nColumnCount;i++)
{
pmyListCtrl->DeleteColumn(0);
}
还有一个:
while (pmyListCtrl->DeleteColumn(0));