。。。這有兩個問題:
1如果隻視改變Panel單存的改變大小,就象樓上所說的用Anchors
但是有一個缺點。當你Panel縮的一定的時候上面的控件就不見了而。小到不見了。反之變的很大。
2.改變顯示器的分辨率問題。也能改變整個Panel的大小
var
Const
Orignwidth=1024;
Orignheight=768;
begin
if (screen.width<>orignwidth) then
begin
height:=longint(height)*longint(screen.height) div orignheight;
width:=longint(width)*longint(screen.width) div orignwidth;
scaleby(screen.width , orignwidth);
end;
end;