delphi中ComboBox的DataValue值


本文整理自网络,侵删。

 

procedure TForm1.Button1Click(Sender: TObject);
var
  s : string;
begin
  combobox1.Clear;
  s := '01';
  combobox1.Items.AddObject('北京',TObject(s));
  s := '02';
  combobox1.Items.AddObject('天津',TObject(s));
  s := '03';
  combobox1.Items.AddObject('上海',TObject(s));
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
  edit1.Text := string(combobox1.Items.Objects[combobox1.ItemIndex]);
end;

相关阅读 >>

Delphi利用系统时间产生随机数的函数

Delphi获取文件创建时间、文件最后修改时间

Delphi 字符串的分割

Delphi psafearray与tbytes类型转换

Delphi2010获取鼠标指向窗口的位置及鼠标在窗口内的相对位置坐标

Delphi opendialog1 打开多个文件

Delphi 带参数的 exit

Delphi 新建一个txt文档函数

Delphi xe程序的主题(theme)设置

Delphi qq尾巴病毒的编写

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...