Hola
felipe_jfx.
Con respecto a tu pregunta; Aparentemente no reduje las líneas de código, pero puedes echarle un vistazo al siguiente código:
Código Delphi
[-]
procedure TForm1.SetWidthsClick(Sender: TObject);
var
i : Integer;
lStName : string;
lComponent : TComponent;
begin
lComponent := nil;
for i := 1 to 12 do
begin
try
lStName := Format('Shape%d', [i]);
lComponent := FindComponent(lStName);
if Assigned(lComponent)
and (lComponent is TShape)
then
begin
TShape(lComponent).Width := SpinEdit1.Value;
end;
finally
lComponent := nil;
lStName := '';
end;
end;
end;
Esto te permitirá buscar todos los objetos de la clase TShape que se llamen Shape[1..12] y modificarles el tamaño.
Un Saludo y Bienvenido al Club!