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 getmimetypefromfile 获取文件mime类型

Delphi 批量生成 a到z 字母

如何用Delphi实现windows xp中“本地连接”的启用和禁用

Delphi 比较两个位图是否相同

Delphi 屏幕整体拉出源代码

Delphi的几种类型转换

Delphi与正则表达式

Delphi 字符串加密解密单元

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



打赏

取消

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

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

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

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

评论

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