CComboBox::GetCount

int GetCount( ) const;

Return Value

The number of items. The returned count is one greater than the index value of the last item (the index is zero-based). It is CB_ERR if an error occurs.

Remarks

Call this member function to retrieve the number of items in the list-box portion of a combo box.

Example

// The pointer to my combo box.
extern CComboBox* pmyComboBox;

// Add 10 items to the combo box.
CString str;
for (int i=0;i < 10;i++)
{
   str.Format(_T("item %d"), i);
   pmyComboBox->AddString( str );
}

// Verify the 10 items were added to the combo box.
ASSERT(pmyComboBox->GetCount() == 10);

CComboBox OverviewClass MembersHierarchy Chart

See Also   CB_GETCOUNT