//我写了一段程序解决你的问题-By SlowDown
//记得 uses inifiles;
procedure TForm1.ButtonRead(Sender: TObject);
var
MyIniFile:TIniFile;
begin
Myinifile:=TIniFile.Create('MyIniFileName.ini');
Edit1.Font.Name
:=MyIniFile.ReadString('StdFrmLayout_Common','DtlFont_Name','宋体');
Edit1.Font.CharSet
:=MyIniFile.ReadInteger('StdFrmLayout_Common','DtlFont_CharSet',134);
Edit1.Font.Color
:=MyIniFile.ReadInteger('StdFrmLayout_Common','DtlFont_Color',-2147483640);
Edit1.Font.Size
:=MyIniFile.ReadInteger('StdFrmLayout_Common','DtlFont_Size',9);
Edit1.Font.Height
:=MyIniFile.ReadInteger('StdFrmLayout_Common','DtlFont_Height',-12);
Myinifile.Free;
end;
procedure TForm1.ButtonWrite(Sender: TObject);
var
MyIniFile:TIniFile;
begin
Myinifile:=TIniFile.Create('MyIniFileName.ini');
MyIniFile.WriteString( 'Edit1_Font', 'Edit1_Font_Name', Edit1.Font.Name);
MyIniFile.WriteInteger( 'Edit1_Font', 'Edit1_Font_CharSet', Edit1.Font.CharSet);
MyIniFile.WriteInteger( 'Edit1_Font', 'Edit1_Font_Color', Edit1.Font.Color );
MyIniFile.WriteInteger( 'Edit1_Font', 'Edit1_Font_Size', Edit1.Font.Size );
MyIniFile.WriteInteger( 'Edit1_Font', 'Edit1_Font_Height',Edit1.Font.Height);
Myinifile.Free;
end;
//