如何将字符串添加到MFC中的组合框

时间:2015-03-17 01:36:42

标签: c++ mfc

我正在使用MFC,我想在组合框中添加字符串。 与添加数据(在资源视图中的组合框属性中的硬编码)不同,我想将它们添加到字符串表中,我的c ++代码必须加载字符串。

请提出建议。

1 个答案:

答案 0 :(得分:1)

- Add combo box to your dialog control
- Right click combo box , goto class wizard and add member variable of type CCombobox [control varable]
-This will add DDX_Control entry
- Now call variable_name.AddString to add strings to your combo box at runtime.
- If you want to use strings from string table then use Loadstring to load a string from string table first.
- Then call variable_name.AddString again ...

.... Have I cleared your doubts ???