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;

相关阅读 >>

Delphi 字符串替换

Delphi xe tparallel.for循环

Delphi图像二值化

Delphi 获取cpuid的函数

Delphi - 如何执行windows、osx、linux的外部程序?

Delphi 将base64字符串转化为jpeg图片

Delphi 缓冲文件流-tbufferedfilestream tfilestream 性能测试

Delphi ascii码表及键盘码表

如何判断硬盘是fat32还是ntfs

解决 Delphi 程序在不同操作系统中 shellexecute 调用 chrome.exe 偶尔无效的问题

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



打赏

取消

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

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

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

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

评论

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