procedure ShapeRec(index:byte;Color:integer); var x : integer; begin for x:=0 to Form1.ComponentCount-1 do if Form1.Components[x] is TShape then if LowerCase((Form1.Components[x] as TShape).Name)='shape'+IntToStr(index) then (Form1.Components[x] as TShape).Brush.Color:=Color; end;