c++ - MFC中如何给组合框添加字符串

标签 c++ mfc

我正在处理 MFC,我想将字符串添加到组合框。 与添加数据(在资源 View 中的组合框属性中进行硬编码)不同,我想将它们添加到字符串表中,而我的 C++ 代码必须加载字符串。

请给点建议。

最佳答案

- 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 ???

关于c++ - MFC中如何给组合框添加字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29089936/

相关文章:

c++ - 在 C++ 类中初始化数组

c++ - 结合使用 std::atomic<bool> 和 std::mutex 的正确性

c++ - 无序映射相等功能 c++

c++ - 处理孙子控件的 WM_NOTIFY

c++ - CArray 的析构函数大约需要 30 秒才能运行

c++ - 阿杜伊诺错误 : too few arguments to function 'int getMode(int, int, int, int, int)'

c++ - 是否可以在 char 中返回 "weird"个字符?

c++ - MFC分配大内存

c++ - 库的字符串编码应该符合 Unicode 还是灵活的?

windows - MFC 本地化不适用于 Windows 7 的 MUI 安装