voidSetItemCountEx(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:
LVSICF_NOINVALIDATEALL The list view control will not repaint unless affected items are currently in view. This is the default value.
LVSICF_NOSCROLL The list view control will not change the scroll position when the item count changes.
Remarks
This member function implements the behavior of the Win32 macro, , 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 Overview | Class Members | Hierarchy Chart
See Also CListCtrl::SetItemCount,