This documentation is archived and is not being maintained.

CListCtrl::GetSelectedCount

Retrieves the number of selected items in the list view control.

UINT GetSelectedCount( ) const;

Return Value

The number of selected items in the list view control.

Example

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

UINT i, uSelectedCount = pmyListCtrl->GetSelectedCount();
int  nItem = -1;

// Update all of the selected items.
if (uSelectedCount > 0)
{
   for (i=0;i < uSelectedCount;i++)
   {
      nItem = pmyListCtrl->GetNextItem(nItem, LVNI_SELECTED);
      ASSERT(nItem != -1);
      pmyListCtrl->Update(nItem); 
   }
}

See Also

CListCtrl Overview | Class Members | Hierarchy Chart | CListCtrl::SetItemCount | CListCtrl::GetItemCount

Show: