Delphi 用ini记录ComboBox的ItemIndex


本文整理自网络,侵删。

 procedure TForm1.ComboBox1Change(Sender: TObject);
var
ini:TInifile;
path,section,key:string;
begin
path := ExtractFilePath(application.ExeName)+'config.ini';
if FileExists(path) then
begin
ini:=Tinifile.Create(path);
Section := 'Config';
Key := 'ComboBox';
ini.WriteInteger(Section,Key,ComboBox1.ItemIndex);
end;
end;


procedure TForm1.FormCreate(Sender: TObject);
var
ini:TInifile;
path,section,key:string;
begin
path := ExtractFilePath(application.ExeName)+'config.ini';
if FileExists(path) then
begin
ini:=Tinifile.Create(path);
ComboBox1.ItemIndex := ini.ReadInteger('Config','ComboBox',0);
end;
end;

相关阅读 >>

如何让dbgrid显示序号?

Delphi msxml 获取 api接口

Delphi中调用http xml

Delphi webbrowser设置自己定义user-agent

Delphi 取得文件夹及下一级文件夹下的文件列表

Delphi检测鼠标指针的改变(全局)

Delphi 递归实现从m 个集合中 任取一个元素 生成组合

Delphi 能否把.txt文件的数据导入到access数据库中

Delphi实现的sunday字符串搜索算法

Delphi Delphi 学习大师qq群讨论的字符串位置替换方法

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



打赏

取消

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

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

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

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

评论

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