CListCtrl::SetItemCountEx

void SetItemCountEx( int iCount, DWORD dwFlags = LVSICF_NOINVALIDATEALL );

Parameters

nItems

Number of items that the control will ultimately contain.

dwFlags

Specifies the behavior of the list view control after resetting the item count. This value can be a combination of the following:

Remarks

This member function implements the behavior of the Win32 macro, ListView_SetItemCountEx, as described in the Platform SDK and should only be called for virtual list views.

Example

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

// Add 1024 items to the list view control.

// Force my virtual list view control to allocate 
// enough memory for my 1024 items.
pmyListCtrl->SetItemCountEx(1024, LVSICF_NOSCROLL|LVSICF_NOINVALIDATEALL);

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

CListCtrl OverviewClass MembersHierarchy Chart

See Also   CListCtrl::SetItemCount,