如何使用数据字段获取组合框显示值? [英] How to get combo-box display values using the Data field?
本文介绍了如何使用数据字段获取组合框显示值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在资源编辑器中将组合框数据设置为first; second; third,但是当我编译程序时,组合框是完全空的,我看不到任何项目。
I have set the combo-box data to "first;second;third" in the resource editor, but when I compile the program, the combo-box is totally empty, I can't see there any items at all.
此外,如何设置默认选择哪个项目?
Also, how do I set which item is selected by default ? And how do I change the currently selected item programmatically ?
推荐答案
在Win32组合框中查看本教程:组合框简介
Checkout this tutorial on Win32 Combo boxes: Introduction to Combo Boxes
如果您使用MFC CComboBox类,那么您需要使用 AddString()
或 InsertString()
在组合框列表中添加元素。
If you are using MFC CComboBox class then you need to use the methods AddString()
or InsertString()
to add elements in the combo box list.
这篇关于如何使用数据字段获取组合框显示值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文