请教:
   我在编程中相让Edit编辑框动态符空值,具体如下:
  有20个编辑框我想利用循环让其自动符空值,如:
  for i:=0 to 20 do
    edit(i).text:='';
  可是不能用请问有别的方法没有?????

解决方案 »

  1.   

    利用edit.tag属性for i:=0 to 20 do
    begin
      if (sender as TEdit).tag=inttostr(i) then
        (sender as TEdit).text:='';
    end;
      

  2.   

    edit:array[1..20] of tedit;....
      for i:=0 to 20 do
        edit[i].text:='';或者用form的Components数组
      

  3.   

    var
      I: Integer;
    begin
      for I:= 0 to ComponentCount -1 do
        if Components[I] is TEdit then
        begin
           TEdit(Components[I]).caption:='';
        end;
    end;
      

  4.   

    先作类型判断    IF...IS...
    再强制类型转换    (...as...).
      

  5.   

    推荐 guestman(天涯浪子) 的方法
      

  6.   

    推荐 guestman(天涯浪子) 的方法
      

  7.   

    请教在上面的回答中
    ComponentCount是什么?