Add a handler for the
CBN_SELCHANGE
event. You can do this via the designer. Select your combobox, and select the Control Events tab in the Properties panel, and choose
CBN_SELCHANGE
. The auto-added handler will look like this:
void CYourDlg::OnCbnSelchangeCombo1()
{
int sel = m_combobox.GetCurSel(); }
The variable
sel
will be the 0 based index of the user's selection