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 vclzip压缩文件夹

Delphi 数组复制利用copymemory 最为完美

Delphi 如何识别应用程序没有响应

Delphi tfilestream流操作1

Delphi 颜色表

Delphi中的sha256算法

Delphi doc转txt

Delphi实现票据精确打印

Delphi 如何快速读写文件中的字符串

Delphi assignfile 与指定的文件建立连接

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



打赏

取消

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

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

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

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

评论

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