TAdvEdit - Persistence property

I'm uncertain how to use the persistence property in runtime on TADVEdit component.
When I in designtime set the property as follows:

Persistence.Key := 'C:\ProgramData\Test.ini';
Persistence.Section := 'MySection';
Persistence.Location := plInifile;
Persistence.Enable := True;

it works fine.

But if I in designtime set the properties as default (enable=False), and in runtime execute the code:

procedure TForm5.FormCreate(Sender : TObject);
begin
AdvEdit1.Persistence.Key := 'C:\ProgramData\Test.ini';
AdvEdit1.Persistence.Section := 'MySection';
AdvEdit1.Persistence.Location := plInifile;
AdvEdit1.Persistence.Enable := True;
end;

it doesn.t work.
I have checked the content of the inifile in the last case and observe that the text entered was there and correct.
But after creating the form again, the text entered didn't appear in the entryfield (only text from design time was in the entryfield)
How can we manage the persistence property in runtime?
br.
Anders Balslev

When you enable this at runtime, force the loading of the persisted value with AdvEdit.LoadPersist;

Thank you very much - works :grinning: