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;