CListBox::GetCount
Retrieves the number of items in a list box.
int GetCount( ) const;
Возвращаемое значение
The number of items in the list box, or LB_ERR if an error occurs.
Заметки
The returned count is one greater than the index value of the last item (the index is zero-based).
Пример
// Add 10 items to the list box.
CString str;
for (int i = 0; i < 10; i++)
{
str.Format(_T("item %d"), i);
m_myListBox.AddString(str);
}
// Verify that 10 items were added to the list box.
ASSERT(m_myListBox.GetCount() == 10);
Требования
Header: afxwin.h