if edit5.text='delete me' then
edit5.destroy;

解决方案 »

  1.   

    动态创建的控件,比方说给其中一个的Name赋值为Edit5Edit5.destroy系统会出错,说Edit5没有定义
      

  2.   

    不可能。开始定义一个 edit5 : TEdit;edit5 := TEdit.Create(self);edit5.free;
      

  3.   

    var i: integer;
    for i:=self.componentcount-1 downto 0 do  
    begin
      if (self.components[i] is TEdit) then
         if (self.components[i] as TEdit).Text:='条件' then
         begin
           self.components[i].free;
           self.components[i]:=nil; ;
         end;
    end;
      

  4.   

    destroy~~~~~~~~~~~~~~~~~~~~~~free.
      

  5.   

    可在一容器中创建控件, 如下:
    for I:=0 to ScrollBox1.controlcount-1 do
    begin
       if (ScrollBox1.Controls[I] is Tedit) then
       begin
         if Tedit(ScrollBox1.Controls[I]).name='your enter text' then
            Scrollbox1.Controls[i].free;
       end;
    end;
      

  6.   

    告诉你一个函数
    FreeAndNil()
    安全释放,绝对好用,不会有什么内存出错等现象
      

  7.   

    inforum的方法可以实现关键的问题是之所以用动态创建Edit,是因为创建的个数不定所以不好提前就定义好Name,我还想知道有没有别的方法可以实现
      

  8.   

    Nizvoo请说得稍微具体一点,怎样指?
      

  9.   

    释放free;
    再置句柄为空。
      

  10.   

    daniel007和wjlsmail能不能把你们各自的方法说得详细一点照顾一下我这个新手(菜鸟),呵呵,多谢了