我需要集体清除EDIT筐里的数据
如:
   
edit2.clear
edit1.clear
edit3.clear
 用什么方法效率更高呢!??
一定给分的!!

解决方案 »

  1.   

    procedure Tfrm.FormShow(Sender: TObject);
    var i:integer;
    begin
     for i:=0 to frm.ComponentCount-1 do
       begin
        if frm.Components[i] is tedit then
          tedit(self.Components[i]).Clear;
       end;end;
      

  2.   

    简洁些:
    for i:=0 to component.count-1 do
    begin
      if components[i] is TEdit then 
        TEdit(components[i]).clear;
    end;
      

  3.   

    呵呵,迟了,如果你不想将窗口中所有的Edit全清空,可以将要清空的放在一个面板上, 清空时,清空指定面板上的.procedure Tform1.ClearEdit(p : TPanel);
    begin
      for i:= 0 to self.ComponentCount - 1 do
        if (self.Components[i] is TEdit) and ((self.Components[i] as TEdit).Parent = p)   then
             (self.Components[i] as TEdit).clear;
    呵呵
    ,混分
    end
      

  4.   

    procedure Tfrm.FormShow(Sender: TObject);
    var 
      i: Integer;
    begin
      for i:=0 to frm.ComponentCount - 1 do
      begin
        if frm.Components[i] is TEdit then
          TEdit(self.Components[i]).Text := '';
      end;
    end;
      

  5.   

    for i:=0 to component.count-1 do
    begin
      if components[i] is TEdit then 
        TEdit(components[i]).clear;
    end;
      

  6.   

    var i:integer;
    begin
      for i:=0 to self.componentcount-1 do
    begin
    if self.components[i] is TEdit then
    tedit(self.components[i]).text:='';
    end;
      

  7.   

    同意,weitao999(涛涛) 
    更简洁些:
    for i:=0 to component.count-1 do if components[i] is TEdit then 
    TEdit(components[i]).clear;
      

  8.   

    接分,这个问题问了NNNNNNNN*N次了哈哈
      

  9.   

    for i:=0 to component.count-1 do
    begin
      if components[i] is TEdit then 
        TEdit(components[i]).clear;
    end;
      

  10.   

    for i:=0 to component.count-1 do
    begin
      if components[i] is TEdit then 
        TEdit(components[i]).clear;
    end;
    接分