CComboBox::GetCurSel

Wywołanie tej funkcji Członkowskich, który element w polu kombi jest zaznaczone.

int GetCurSel( ) const;

Wartość zwracana

Wyświetlanego aktualnie zaznaczonego elementu w polu listy, pola kombi lub CB_ERR , jeśli element nie jest zaznaczony.

Uwagi

GetCurSelZwraca indeks do listy.

Przykład

// Select the next item of the currently selected item  
// in the combo box. 
int nIndex = m_pComboBox->GetCurSel();
int nCount = m_pComboBox->GetCount();
if ((nIndex != CB_ERR) && (nCount > 1))
{
   if (++nIndex < nCount)
      m_pComboBox->SetCurSel(nIndex);
   else
      m_pComboBox->SetCurSel(0);
}

Wymagania

Nagłówek: afxwin.h

Zobacz też

Informacje

Klasa CComboBox

Diagram hierarchii

CComboBox::SetCurSel

CB_GETCURSEL