| 
							Nilbog
							 
								Гость 
							 
						 | 
						
							
								  | 
								
									
									 « Ответ #6 : 18-08-2005 09:16 »   | 
								
								 | 
							  
							 
							во хороший пример сохранений настроек накопал в хэлпе:
  с помощю ini файла
 
  uses IniFiles;
  procedure TForm1.FormCreate(Sender: TObject); var   F: TIniFile;   names: TStringList;   i: integer; begin   F := TIniFile.Create(ExtractFilePath(ParamStr(0)) +     'window.ini');
    Form1.Left := F.ReadInteger('position', 'left', 0);   Form1.Width := F.ReadInteger('position', 'width', 200);   Form1.Top := F.ReadInteger('position', 'top', 0);   Form1.Height := F.ReadInteger('position', 'height', 200);
    Edit1.Text := F.ReadString('tools', 'edit1', 'no text');
    Edit2.Text := IntToStr(F.ReadInteger('tools', 'koef', 0));   CheckBox1.Checked := F.ReadBool('tools', 'check', true);
    names := TStringList.Create;   F.ReadSection('files', names);   for i := 0 to Names.Count - 1 do     ListBox1.Items.Add(F.ReadString('files', names.Strings,     ''));   names.Destroy;
    F.Destroy; end;
  procedure TForm1.FormDestroy(Sender: TObject); var   F: TIniFile;   i: integer; begin
    F := TIniFile.Create(ExtractFilePath(ParamStr(0)) +     'window.ini');
    F.WriteInteger('position', 'left', Form1.Left);   F.WriteInteger('position', 'width', Form1.Width);   F.WriteInteger('position', 'top', Form1.Top);   F.WriteInteger('position', 'height', Form1.Height);
    F.WriteString('tools', 'edit1', Edit1.Text);   F.WriteInteger('tools', 'koef', StrToIntDef(Edit2.Text, 0));   F.WriteBool('tools', 'check', CheckBox1.Checked);
    for i := 0 to ListBox1.Items.Count - 1 do
      F.WriteString('files', 'file' + IntToStr(i+1), ListBox1.Items.Strings);
    F.Free; end;
  procedure TForm1.Button1Click(Sender: TObject); begin   ListBox1.Items.Add(Edit1.Text); end; 
						 |