unit umain; {$mode objfpc}{$H+} interface uses Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls, RTTIGrids; type { TForm1 } TForm1 = class(TForm) Edit1: TEdit; LabeledEdit1: TLabeledEdit; TIPropertyGrid1: TTIPropertyGrid; ToggleBox1: TToggleBox; procedure ToggleBox1Change(Sender: TObject); private public end; var Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.ToggleBox1Change(Sender: TObject); begin case ToggleBox1.Checked of False: begin TIPropertyGrid1.TIObject := Edit1; Edit1.SetFocus; ToggleBox1.Caption := 'Point grid to LabeledEdit'; end; True: begin TIPropertyGrid1.TIObject := LabeledEdit1; LabeledEdit1.SetFocus; ToggleBox1.Caption := 'Point grid to Edit'; end; end; end; end.