让窗体自适应分辨率 const orignwidth=800; orignheight=600;procedure TForm1.Formcreate(sender:tobject); begin scaled:=true; if (screen.width<>orighwidth) then begin height:=longint(height)*longint(screen.height) div orignheight; width:=longint(width)*longint(screen.width) div orignwidth; scaledby(screen.width,orignwidth); end; end;
如果可以的话,那就是delphi的一个bug
我当时也遇到这样的问题,
最后我把程序界面重新作了一便就好了,
而且我和原来的程序对比了一下,完全一样的设置,
但保存后在打开,里面有很多界面上一样,但View as text里有许多数据被改了。
你在调试吧。
good luck
1. 将Form的属性Scaled设为false.
2. Form的属性Scaled设为true,但是属性AutoScroll设为false。
const
orignwidth=800;
orignheight=600;procedure TForm1.Formcreate(sender:tobject);
begin
scaled:=true;
if (screen.width<>orighwidth) then
begin
height:=longint(height)*longint(screen.height) div orignheight;
width:=longint(width)*longint(screen.width) div orignwidth;
scaledby(screen.width,orignwidth);
end;
end;