CComboBox::GetCount

콤보 상자의 목록 상자 부분에서 항목을 검색 하려면이 멤버 함수를 호출 합니다.

int GetCount( ) const;

반환 값

항목 수입니다. 반환 된 횟수 (인덱스는 0부터 시작)에서 마지막 항목의 인덱스 값 보다 큰 하나입니다. 이 CB_ERR 오류가 발생 합니다.

예제

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

요구 사항

헤더: afxwin.h

참고 항목

참조

CComboBox 클래스

계층 구조 차트

CB_GETCOUNT