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 tstringlist的delimitedtext的空格问题

Delphi xe 制作的萤光时钟,可改作屏保

Delphi 判断是否是系统管理员身份

Delphi 向windows窗口发送alt组合键的问题

Delphi datasnap清除僵死连接

Delphi 获取外网ip的函数

Delphi xe 遍历指定数据库,清空各表记录

d10环境下调用hidcontroller1.0.35获取数据乱码问题

Delphi 农历源码

Delphi将image存入mysql数据库

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



打赏

取消

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

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

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

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

评论

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