var
  a: TComponent;for i := 1 to n do
begin
  a := FindComponent(Format('label%d', [i]));
  if (a <> nil) and (a is TLabel) then
    TLabel(a).Caption := listbox1.Items[i - 1];
end;

解决方案 »

  1.   

    for i:=0 to n do
     ComponentName[i]:= listbox1.items[i];
      

  2.   

    for ii :=1 to 100 do
        TLabel(FindComponent('label'+InttoStr(ii))).Caption    := listbox1.items[ii-1];
      

  3.   

    其实以上的回答都不太对,因为rst_2828 (海岛管理员) 的程序中有listbox1和listbox2,而且没规律。嘻嘻!
      

  4.   

    surfguy(冲浪小子) 观察的挺仔细的哦
      

  5.   

    如果象surfguy(冲浪小子) 所说,没规律可不好做