Condividi tramite


CComboBox::GetCount

Chiamare la funzione membro per recuperare il numero di elementi nella parte di tipo casella di riepilogo della casella combinata.

int GetCount( ) const;

Valore restituito

Numero di elementi.Il valore restituito è una maggiore del valore di indice dell'ultimo elemento (indice a base zero).È CB_ERR se si verifica un errore.

Esempio

// 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);

Requisiti

Header: afxwin.h

Vedere anche

Riferimenti

Classe di CComboBox

Grafico della gerarchia

CB_GETCOUNT