Ver Mensaje Individual
  #3  
Antiguo 12-02-2013
Avatar de movorack
[movorack] movorack is offline
Miguel A. Valero
 
Registrado: feb 2007
Ubicación: Bogotá - Colombia
Posts: 1.346
Reputación: 20
movorack Va camino a la famamovorack Va camino a la fama
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!
__________________
Buena caza y buen remar... http://mivaler.blogspot.com
Responder Con Cita