Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Call this member function to retrieve the number of items in the list-box portion of a combo box.
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.
Example
// Add 10 items to the combo box.
CString strItem;
for (int i = 0; i < 10; i++)
{
strItem.Format(_T("item %d"), i);
m_pComboBox->AddString(strItem);
}
// Verify the 10 items were added to the combo box.
ASSERT(m_pComboBox->GetCount() == 10);
Requirements
Header: afxwin.h