function FindComponent(const AName: string): TComponent;DescriptionFindComponent returns the component in the Components property array with the name that matches the string in the AName parameter. Use FindComponent to determine whether a given component is owned by another.form1.FindComponent('led1')   etc

解决方案 »

  1.   

    你的意思是不是要得到这个一个Led1,Led2,Led3.......的列表?建议用一个列表容器比如:TList对象保存。var  
       i  :  integer;  
       Led  :  string;  
       LedList:TList;
    begin  
       LedList:=TStringList.Create;
       for  i:=1  to  12  do  
       begin  
           LedList.Add(Format('LED%d',[i]))      //Led='Led1'  
       end;    
       for  i:=17  to  52  do  
       begin  
           LedList.Add(Format('LED%d',[i]))      //Led='Led1'  
       end;    
    .....  
    end;  最后得到的就是你想要的Led名字列表!
      

  2.   

    Agree with two floor,
    Use findcomponent(the name of component) or className(FindComponent(the name of component))etc:Tedit(findcomponent('edit1'));
      

  3.   

    var  
       i  :  integer;  
       Led  :  string;  
    begin  
       for  i:=1  to  12  do  
       begin  
           Led:=Format('LED%d',[i])      //Led='Led1'  
       end;    
       for  i:=17  to  52  do  
       begin  
           Led:=Format('LED%d',[i])  
       end;    
    .....    你可以这样操作Tlable(led).caption:=''
      类似你可以去发挥。