unit DemoFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, IniFiles;
type
TDemoForm =
class(TForm)
Memo: TMemo;
ActionPanel: TPanel;
Button: TButton;
ComboBox: TComboBox;
Edit: TEdit;
procedure ButtonClick(Sender: TObject);
procedure ComboBoxChange(Sender: TObject);
private
mif: TMemIniFile;
end;
var
DemoForm: TDemoForm;
implementation
{$R *.dfm}
procedure TDemoForm.ButtonClick(Sender: TObject);
begin
if FileExists(Edit.Text)
then
begin
FreeAndNil(mif);
mif := TMemIniFile.Create(Edit.Text);
mif.ReadSections(ComboBox.Items);
end else ComboBox.Clear;
end;
procedure TDemoForm.ComboBoxChange(Sender: TObject);
begin
mif.ReadSectionValues(ComboBox.Text, Memo.Lines);
end;
end.