Add strings to MFC ComboBox

不问归期 提交于 2019-12-25 18:26:27

问题


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:


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.



来源:https://stackoverflow.com/questions/23738212/add-strings-to-mfc-combobox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!