谢了!

解决方案 »

  1.   

    Component.Visible := false;
    没有Visible属性的
    Component.destroy;是这个意思吗?
      

  2.   

    在动态生成控件的时候,给该控件起个名字,然后用名字调用它
    下面是动态创建和销毁控件的例子:
    procedure TForm1.Button1Click(Sender: TObject);
    var
     myLabel:TLabel;
    begin
     myLabel:=TLabel.Create(Form1);
     myLabel.Name:='togo';
     myLabel.Parent:=Form1;
     myLabel.Caption:='ReadyToBeDestroyed';
     myLabel.Show;
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
     TLabel(FindComponent('togo')).Destroy;
    end;
      

  3.   

    我试试吧,我试过用循环scrollbox1.component[i].destroy
    可是出错,他说是关于bound的问题,是不是数组的范围不对啊?