到了1024×768后,就不满屏了,
如何使程序在开始能自动侦测分辨率,并使界面自动达到全屏?
14 个解决方案
#1
Form1.WindowState := wsMaximized;
#2
那如何使程序在开始能自动侦测分辨率,我的子窗体要按分辨率进行比率的缩放呀!
(只有主窗体开始是全屏的)
(只有主窗体开始是全屏的)
#3
两种方法,一种是应用程序窗口适应屏幕,就是楼上仁兄说的最大化窗口,缺点是窗口上的控件要重新定位才好看。另一种是屏幕适应程序窗口。可以用Screen.Width, Screen.Height测到当前屏幕大小。保存大小后将屏幕分辨率重新设置为应用程序窗口大小(有API函数),程序结束前,再将原来屏幕分辨率恢复。这种方式请将Form的Position设置为poScreenCenter
#4
Form1.WindowState := wsMaximized;
#5
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Height:=screen.Height;
#6
procedure respective(form:Tform);
Const
Orignwidth=800;
Orignheight=600;
var
fwidth:integer;
begin
if screen.width<>orignwidth then
begin
fwidth:=form.width;
form.scaled:=true;
form.font.size:=(form.width div fwidth)*form.font.size;
form.scaleby(screen.width,orignwidth);
form.height:=longint(form.height)*longint(screen.height) div orignheight;
form.width:=longint(form.width)*longint(screen.width) div orignwidth;
end;
end;
Const
Orignwidth=800;
Orignheight=600;
var
fwidth:integer;
begin
if screen.width<>orignwidth then
begin
fwidth:=form.width;
form.scaled:=true;
form.font.size:=(form.width div fwidth)*form.font.size;
form.scaleby(screen.width,orignwidth);
form.height:=longint(form.height)*longint(screen.height) div orignheight;
form.width:=longint(form.width)*longint(screen.width) div orignwidth;
end;
end;
#7
up
#8
self.Width:=screen.Width;
self.Height:=screen.Height;
就可以了
self.Height:=screen.Height;
就可以了
#9
写在formcreate事件里面.
#10
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Height:=screen.Height;
#11
同一楼上
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Width:=screen.Width;
form1.Height:=screen.Height;
#12
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Height:=screen.Height;
#13
不改变屏幕布局的最简单方法——改变分辨率
procedure SetRes(XRes, YRes: DWord);
var
lpDevMode : TDeviceMode;
begin
EnumDisplaySettings(nil, 0, lpDevMode);
lpDevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
lpDevMode.dmPelsWidth:=XRes;
lpDevMode.dmPelsHeight:=YRes;
ChangeDisplaySettings(lpDevMode, 0);
end;
procedure SetRes(XRes, YRes: DWord);
var
lpDevMode : TDeviceMode;
begin
EnumDisplaySettings(nil, 0, lpDevMode);
lpDevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
lpDevMode.dmPelsWidth:=XRes;
lpDevMode.dmPelsHeight:=YRes;
ChangeDisplaySettings(lpDevMode, 0);
end;
#14
出差,刚回,买上给分
谢谢各位!!!!
谢谢各位!!!!
#1
Form1.WindowState := wsMaximized;
#2
那如何使程序在开始能自动侦测分辨率,我的子窗体要按分辨率进行比率的缩放呀!
(只有主窗体开始是全屏的)
(只有主窗体开始是全屏的)
#3
两种方法,一种是应用程序窗口适应屏幕,就是楼上仁兄说的最大化窗口,缺点是窗口上的控件要重新定位才好看。另一种是屏幕适应程序窗口。可以用Screen.Width, Screen.Height测到当前屏幕大小。保存大小后将屏幕分辨率重新设置为应用程序窗口大小(有API函数),程序结束前,再将原来屏幕分辨率恢复。这种方式请将Form的Position设置为poScreenCenter
#4
Form1.WindowState := wsMaximized;
#5
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Height:=screen.Height;
#6
procedure respective(form:Tform);
Const
Orignwidth=800;
Orignheight=600;
var
fwidth:integer;
begin
if screen.width<>orignwidth then
begin
fwidth:=form.width;
form.scaled:=true;
form.font.size:=(form.width div fwidth)*form.font.size;
form.scaleby(screen.width,orignwidth);
form.height:=longint(form.height)*longint(screen.height) div orignheight;
form.width:=longint(form.width)*longint(screen.width) div orignwidth;
end;
end;
Const
Orignwidth=800;
Orignheight=600;
var
fwidth:integer;
begin
if screen.width<>orignwidth then
begin
fwidth:=form.width;
form.scaled:=true;
form.font.size:=(form.width div fwidth)*form.font.size;
form.scaleby(screen.width,orignwidth);
form.height:=longint(form.height)*longint(screen.height) div orignheight;
form.width:=longint(form.width)*longint(screen.width) div orignwidth;
end;
end;
#7
up
#8
self.Width:=screen.Width;
self.Height:=screen.Height;
就可以了
self.Height:=screen.Height;
就可以了
#9
写在formcreate事件里面.
#10
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Height:=screen.Height;
#11
同一楼上
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Width:=screen.Width;
form1.Height:=screen.Height;
#12
form1.Width:=screen.Width;
form1.Height:=screen.Height;
form1.Height:=screen.Height;
#13
不改变屏幕布局的最简单方法——改变分辨率
procedure SetRes(XRes, YRes: DWord);
var
lpDevMode : TDeviceMode;
begin
EnumDisplaySettings(nil, 0, lpDevMode);
lpDevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
lpDevMode.dmPelsWidth:=XRes;
lpDevMode.dmPelsHeight:=YRes;
ChangeDisplaySettings(lpDevMode, 0);
end;
procedure SetRes(XRes, YRes: DWord);
var
lpDevMode : TDeviceMode;
begin
EnumDisplaySettings(nil, 0, lpDevMode);
lpDevMode.dmFields:=DM_PELSWIDTH or DM_PELSHEIGHT;
lpDevMode.dmPelsWidth:=XRes;
lpDevMode.dmPelsHeight:=YRes;
ChangeDisplaySettings(lpDevMode, 0);
end;
#14
出差,刚回,买上给分
谢谢各位!!!!
谢谢各位!!!!