const
ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
ScreenHeight: LongInt = 600;
Orignwidth=800;
Orignheight=600;
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);
程序运行时先检测分辨率
if Screen.Width = 1024 then
begin
//设置窗体最大化
Self.WindowState := wsMaximized;
end
else
begin
//大小自己定
Self.Width := 800;
Self.Height := 600;
end;