MFC
Expand Minimize
0 out of 1 rated this helpful - Rate this topic

CListCtrl::GetSelectedCount

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

UINT GetSelectedCount( ) const;

The number of selected items in the list view control.

UINT i, uSelectedCount = m_myListCtrl.GetSelectedCount();
int  nItem = -1;

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

Header: afxcmn.h

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.