We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

CListCtrl::DeleteColumn

Deletes a column from the list view control.

BOOL DeleteColumn( 
   int nCol  
);

nCol

Index of the column to be deleted.

Nonzero if successful; otherwise zero.

int nColumnCount = m_myListCtrl.GetHeaderCtrl()->GetItemCount();

// Delete all of the columns. 
for (int i=0; i < nColumnCount; i++)
{
   m_myListCtrl.DeleteColumn(0);
}

Header: afxcmn.h

Show: