var cmp:tcomponent; i:integer;begin for i:=1 to 10 do begin cmp:=FindComponent('xm'+inttostr(i)); if assigned(cmp) and (cmp is tlabel) then tlabel(cmp).caption:='xm'+inttostr(i); end;end;
var lbs : array of Tlabel; I : Integer;begin setlength(lbs, 10); for I := 0 to 10 -1 do lbs := Tlabel(FindComponent('xm'+inttostr(i))); ..... 以后你就可以用lbs来访问了