formcreate()
var
i:integer;
begin
i:=screen.PixelsPerInch/96;
form.width:=form.width*i;
form.height:=form.height*i
end;
var
i:integer;
begin
i:=screen.PixelsPerInch/96;
form.width:=form.width*i;
form.height:=form.height*i
end;
解决方案 »
- 求解GetProp函数
- 为何DataModule数据模件中不能放MSCOMM32.ocx ?
- 如何得到一个字符串的16进制编码?
- 求救,在Delphi中使用RegOpenKeyEx函数打开注册表???
- 庆祝《Delphi 7项目开发实践》新书上市
- 请问应该如果解开winzip 压缩的文件?
- 谁有wise installation system 9.02 的教程?
- 初学listview,我在listview添了6个item,请问我点了第一项触发了什么事件,点了第二项触发了什么事件,我还想可以用右键电击各个项目,怎
- 请问各位怎样定义一个结构体指针的数组
- 各位大虾,小弟在作一个物业管理软件,有作过的,可否近来指点指点!先谢了!
- 有谁遇到过这个问题百思不得其解,~~~~晕
- 用Delphi关闭W2000或NT的源码。
应该是:
formcreate()
var
i:integer;
begin
i:=screen.PixelsPerInch div 96;
form.width:=form.width*i;
form.height:=form.height*i
end;
在每一个窗体创建后执行
const
//设定程序设计期的分辨率
//当用户的显示器与设计期分辨率不同时,窗体可以自适应。
Orignwidth=1024; //不需要了
Orignheight=768;procedure ScreenChange(Sender: TForm);
var
FontSize: Integer;
begin
FontSize := Sender.Font.Size; if (Screen.Width <> OrignWidth) then
begin
Sender.Height := Longint(Sender.Height) * longint
(Screen.Height) div OrignHeight;
Sender.width := longint(Sender.width) * longint
(Screen.Width) div OrignWidth;
Sender.ScaleBy(Screen.Width , OrignWidth);
end;
If Screen.PixelsPerInch <> 96 Then
Sender.ScaleBy(Screen.PixelsPerInch, 96); Sender.Font.Size := FontSize;
End;
End;}
end;
改分辨率是个可行的办法,但是就怕用户不愿意。
些个函数,计算当前屏幕大小与设计时屏幕大小之比,确定控件位置和适当改变控件大小应该是最好的方法。使控件按黄金分割排列最好。
scaled---> false
scaled---> True