将字符串添加到MFC ComboBox

编程入门 行业动态 更新时间:2024-10-10 06:14:46
本文介绍了将字符串添加到MFC ComboBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

正在尝试向ComboBox添加字符串:

Trying to add strings to ComboBox:

BOOL CMyAppDlg::OnInitDialog() { CComboBox *combo= (CComboBox *)GetDlgItem(IDC_COMBO_TT); combo->AddString("s1"); combo->AddString("s2"); // ... return TRUE; }

为什么ComboBox列表仍为空?

Why ComboBox list is still empty?

推荐答案

如果你调用combo-> SetCurSel(0),你看到第一个字符串吗?如果是这样,意味着组合框下拉大小为零。在视觉对话框编辑器中单击组合的向下箭头,然后将底部边缘向下拖动以调整下拉部分的大小。

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.

更多推荐

将字符串添加到MFC ComboBox

本文发布于:2023-05-31 10:29:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/389907.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字符串   MFC   ComboBox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!