Export (0) Print
Expand All
MFC
Expand Minimize
This topic has not yet been rated - Rate this topic

CListCtrl::SetItemCount

Prepares a list view control for adding a large number of items.

void SetItemCount( 
   int nItems  
);
nItems

Number of items that the control will ultimately contain.

To set the item count for a virtual list view control, see CListCtrl::SetItemCountEx.

This member function implements the behavior of the Win32 macro, ListView_SetItemCount, as described in the Windows SDK.

CString str;

// Add 1024 items to the list view control.
m_myListCtrl.SetItemCount(1024);

for (int i = 0; i < 1024; i++)
{
   str.Format(TEXT("item %d"), i);
   m_myListCtrl.InsertItem(i, str);
}

Header: afxcmn.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.