TRegManager は INI ファイル・レジストリへの読み書きでラクをするための コンポーネントです。

下図コンポーネントエディタで各項目を設定し、アイテムを追加して行きます。


書き込むときは

RegManager1['Edit1Text'].AsString := Edit1.Text;
RegManager1['Form1Width'].AsInteger := Form1.Width;


読み込むときは

Edit1.Text := RegManager1['Edit1Text'].AsString;
Form1.Width := RegManager1['Form1Width'].AsInteger;


というコーディングだけで、INI ファイル・レジストリへアクセス することが可能になります。


また、TComponent をまるごと保存復帰することが出来ますので、 TEditor 付属の TEditorProp コンポーネントを利用して

EditorProp1.Assign(Editor1);
RegManager1['EditorProp1'].WriteComponent(EditorProp1);


とすることで、Editor1 のプロパティ値を保存することが出来ます。

読み込むときは

RegManager1['EditorProp1'].ReadComponent(EditorProp1);
EditorProp1.AssignTo(Editor1);


とします。