test:= 对象名.Create;
test.fuction()
未加验证

解决方案 »

  1.   

    TEdit(FindComponent('Edit1')).Text := '参考';
      

  2.   

    用findcomponent函数吧,
    不过这个函数的效率很低,一般时候没有人采用他的!
    看看帮助就全明白了!
      

  3.   

    TEdit(FindComponent('Edit1')).Text := '参考';//好
    也可以用循环
    for i:=0 to Componentcount-1 do
     
      

  4.   

    假设你的对象的Owner为Form1,那么可以这样:
    function TForm1.StrToComponent(NameStr: String): TButton;//假设你的对象类型为TButton,根据你的实际情况更改
    begin
      if From1.FindComponent(NameStr) is TButton then  //Form1根据实际更改
        Result := From1.FindComponent(NameStr) as TButton; 
    end;
    //这个函数返回值就是该对象了
    —————————————————————————————————
    MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
                 毁誉由人,望天上云卷云舒,聚散任风。';
    if Not Assigned(I) then
      I := TI.Create(Nil);
    I.Maxim := MaximStr;
    I.Explain := '假如上述代码中出现“OA”等字样,删除它们';
    I.Desire := '加不加分随你';
    —————————————————————————————————
           
      

  5.   

    lxpbuaa(桂枝香在故国晚秋),我的水平有限吗?怎么年不明白呀。
      

  6.   

    var mycomp:String;
    begin
      mycomp:='Button1';
      //这样访问
      TButton(FindComponent(mycomp)).Caption:='This is a test';
      ~~~|~~~~
         这个是所要找的元件的类型如TEdit等 
    end;