Чтение
TabSheet1.Font.Color:=IniFile.ReadInteger('-----TabSheet1_Font_Color-----','8',TabSheet1.Font.Color);
TabSheet1.Font.Size:=IniFile.ReadInteger('-----TabSheet1_Font_Size-----','9',TabSheet1.Font.Size);
TabSheet1.Font.Style:=IniFile.ReadInteger('-----TabSheet1_Font_Style-----','10',TabSheet1.Font.Style); - ругается
TabSheet1.Font.Name:=IniFile.ReadString('-----TabSheet1_Font_Name-----','11',TabSheet1.Font.Name);
Запись
IniFile.WriteInteger('-----TabSheet1_Font_Color-----','8',TabSheet1.Font.Color);
IniFile.WriteInteger('-----TabSheet1_Font_Size-----','9',TabSheet1.Font.Size);
IniFile.WriteInteger('-----TabSheet1_Font_Style-----','10',Byte(TabSheet1.Font.Style));
IniFile.WriteString('-----TabSheet1_Font_Name-----','11',TabSheet1.Font.Name);
[-----TabSheet1_Font_Color-----]
8=255
[-----TabSheet1_Font_Size-----]
9=16
[-----TabSheet1_Font_Name-----]
11=Times New Roman
[-----TabSheet1_Font_Style-----]
10=0
procedure TForm1.Button1Click(Sender: TObject);
var
IniFile : TIniFile;
begin
IniFile := TIniFile.Create('myIni.ini');
with Edit1.Font do with IniFile do begin
Name := ReadString ('Font','Name','MS Mans Serif');
Charset := ReadInteger('Font','Charset',RUSSIAN_CHARSET);
Color := ReadInteger('Font','Color', clWindowText);
Height := ReadInteger('Font','Height',-11);
Size := ReadInteger('Font','Size',8);
Style := TFontStyles(Byte(ReadInteger('Font','Style',0)));
end;
IniFile.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
var
IniFile : TIniFile;
begin
IniFile := TIniFile.Create('myIni.ini');
with Edit1.Font do with IniFile do begin;
WriteString ('Font','Name', Name);
WriteInteger('Font','Charset', Charset);
WriteInteger('Font','Color', Color);
WriteInteger('Font','Height', Height);
WriteInteger('Font','Size', Size);
WriteInteger('Font','Style',Byte(Style));
end;
IniFile.Free;
end;
Style := TFontStyles(Byte(ReadInteger('Font','Style',0)))
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.