1、根据新的分辨率重画表单和控件
Const
Orignwidth=800;
Orignheight=600;
procedure TForm1.FormCreate(Sender: TObject);
begin
scaled:=true;
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;
2、更改分辨率为你设计时的分辨率
procedure TForm1.FormCreate(Sender: TObject);
var
devmode:tDevicemode;
begin
if screen.width<>orignwidth then
begin
if EnumDisplaySettings(nil,0,devmode) then
begin
devmode.dmfields:=dm_pelswidth OR dm_pelsheight ;
devmode.dmpelswidth:=orignwidth;
{宽度}
devmode.dmpelsheight:=orignheight;{高度}
ChangeDisplaySettings(devmode,0);
{更改设置}
end;
end;
end;