procedure TForm1.FormCreate (Sender: TObject);
begin
FR := Trectangle.Create (Panel1);
FR.Parent := Panel1;
FR.Canvas.BeginScene;
FR.Canvas.Fill.Color := TAlphaColors.Black;
FR.Canvas.Stroke.Color := TAlphaColors.Green;
FR.SetBounds (200, 200, 50, 300);
FR.OnClick := Button1Click;
FR.Canvas.EndScene;
end; // FormCreate //
begin
FR := Trectangle.Create (Panel1);
FR.Parent := Panel1;
FR.Canvas.BeginScene;
FR.Canvas.Fill.Color := TAlphaColors.Black;
FR.Canvas.Stroke.Color := TAlphaColors.Green;
FR.SetBounds (200, 200, 50, 300);
FR.OnClick := Button1Click;
FR.Canvas.EndScene;
end; // FormCreate //