问个简单问题:怎样让下拉列表框在初始化的时候就填充一个字符串?

libraworm 2003-09-08 01:38:39
默认的是不显示任何东西,除非手动选择一个选项才会有内容,
怎样在初始化的时候自动选择其中的一个item?

多谢,
...全文
45 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
libraworm 2003-09-08
  • 打赏
  • 举报
回复
多谢,,

事实证明,如果combobox是下拉列表模式,不能用ComboBox1->Text = "*";而只能用ComboBox1->ItemIndex = 0;
crysword 2003-09-08
  • 打赏
  • 举报
回复
ComboBox1->ItemIndex = 0;
ComboBox1->Text = "";
都可以吧,看你想怎么用了.
gyj_china 2003-09-08
  • 打赏
  • 举报
回复
推荐ComboBox1->ItemIndex = 0;
int64 2003-09-08
  • 打赏
  • 举报
回复
ComboBox1->Text=×××
chen_czf 2003-09-08
  • 打赏
  • 举报
回复
自己赋个值先
kmfangxun 2003-09-08
  • 打赏
  • 举报
回复
Indicates which item in the drop-down list is selected.

__property int ItemIndex = {read=GetItemIndex, write=SetItemIndex, nodefault};

Description

Read ItemIndex to determine which item in the list is the selected value in the combo box. This value appears in the edit box portion of the combo box. The first item in the list has index 0, the second item has index 1, and so on. If no item is selected, the value of ItemIndex is -1.

Write to ItemIndex to programmatically select an item from the list by passing in the index value.
kmfangxun 2003-09-08
  • 打赏
  • 举报
回复

ComboBox1->ItemIndex=0

13,825

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder相关内容讨论区
社区管理员
  • 基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧