在窗体的最下方有个GroupBox,当GroupBox不可见的时候如何让窗体自动调整缩小??

解决方案 »

  1.   

    写个过程咯,把groupbox的height减掉就是了
      

  2.   

    autosize:=true;
    或者代码
    如下:
    procedure TScanF.changsize();
    var i, H            : integer;
    begin
      H := 0;
      for i := 0 to self.ComponentCount - 1 do
      begin
        if self.Components[i] is trzgroupbox then
        begin
          if trzgroupbox(self.Components[i]).Visible then
            H := h + trzgroupbox(self.Components[i]).Height;
        end;
      end;
      if h > 0 then
        self.Height := RzToolbar.Height + h + 30;
      self.Width := formwidth;
    end;
      

  3.   

    我手头上有个程序,它实现 了我上面说的功能,它既没有autosize:=true;这样,也没有写相应的过程,我找遍了整个程序都找到答案,不知道它是怎么实现 的?