PageControl控件的高度自适应(遍历tabSheet内所有控件)
maxHeight := 0;
with cxPageControl1.ActivePage do
begin
for i := 0 to ControlCount - 1 do
begin
t := TControl(Controls[i]);
if maxHeight < (t.Top + t.Height) then
begin
maxHeight := t.Top + t.Height;
end;
end;
end;
if maxHeight > 21 then
cxPageControl1.Height := maxHeight + 21
else
cxPageControl1.Height := 21;

浙公网安备 33010602011771号