setLength(tmpstatic,0);
    tmpstatic:=nil;
    setlength(tmpedit,0);
    tmpedit:=nil;
    with datamodule1.SQLQuery1 do
    begin
      sql.Clear;
      sql.add('select e_amount from shd_d'+zt+' where s_order_d="'+form44.Label7.Caption+'"');
      open;
      SetLength(tmpstatic,rowsaffected);
      setlength(tmpedit,rowsaffected);
      for i:=0 to rowsaffected-1 do
      begin
        tmpstatic[i]:=Tstatictext.Create(self);
        tmpstatic[i].Parent:=GroupBox1;
        tmpstatic[i].Caption :=fieldbyname('e_amount').AsString;
        tmpstatic[i].Width:=100;
        tmpstatic[i].Top:=i*25+45;
        tmpstatic[i].Left:=18;
     // tmpcheck[i].OnClick:=CheckBoxClick;
        tmpstatic[i].Show;        tmpedit[i]:=Tedit.Create(self);
        tmpedit[i].Parent:=GroupBox1;
        tmpedit[i].text :=fieldbyname('e_amount').AsString;
        tmpedit[i].Width:=100;
        tmpedit[i].Top:=i*25+45;
        tmpedit[i].Left:=150;
        tmpedit[i].Show;
        Next;
      end; //end for
    close;
    end;  //end with
以上是在单击事件中
是这样的,如果第一次有两个数组,第二次有一个数组的话,显示时还是有两个控件。
怎么解决?