procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
with TShape.Create(Self) do
begin
Parent:=Panel1;
Shape:=ReferenceShape.Shape;
Brush:=ReferenceShape.Brush;
{Copy/set other properties as required}
Left:=X-Panel1.Left-Self.Left;
Top:=Y-Panel1.Top-Self.Top;
{not sure I've got Left/Top correct, but you get the idea <g>}
end;
end;
By making the owner the form (self) the new shape will be freed by the form when the form is freed.
Have fun
Simon