窗口自适应分辨率问题?????
我在书上看到这样一段自适应窗体的代码!
const displaywidth=800;
displayheight=600;
type
Tfooclass=class(Tcontrol);
//以下为Formcreate事件内写的代码:
var
i:integer;
begin
scaled:=true;
if (screen.width<>displaywidth) then
begin
height:=longint(height)*longint(screen.height) div displayheight;
width:=longint(width)*longint(screen.width) div displaywidth;
scaleby(screen.width , displaywidth);
end;
for i:=controlcount-1 downto 0 do
begin
Tfooclass(controls[i]).Font.Size:=(newformwith div oldformwith)*Tfooclass(controls[i]).Font.Size;
end;
end;
可是在调试过程中总是出现newformwith 和 oldformwith 没有定义,请教其在哪里定义
如果有好的方法请赐教,多谢!!!!!!!!!