Add strings to MFC ComboBox

2019-09-19 16:33发布

Trying to add strings to ComboBox:

BOOL CMyAppDlg::OnInitDialog()
{

    CComboBox *combo= (CComboBox *)GetDlgItem(IDC_COMBO_TT);
    combo->AddString("s1");
    combo->AddString("s2");

    // ...
    return TRUE;
}

Why ComboBox list is still empty?

1条回答
beautiful°
2楼-- · 2019-09-19 17:20

Do you see the first string if you call combo->SetCurSel(0)? If so it means the combo box drop down size is zero. In the visual dialog editor click on the combo's down arrow then drag the bottom edge down to resize the drop down part.

查看更多
登录 后发表回答