怎样使在800*600像素开发的程序,在1024*768中正常显示?
解决方案 »
- 关于 ClientSocket和ServerSocket问题.
- delphi数组御环输出问题?
- 使用Delphi下的Socket控件连接Linux 下的SOCKET Server
- ADO的Locate与Lookup方法有什么区别啊?
- ■■为什么创建SurFace的时候会失败?
- 如何激活DBGrid的当前行
- 高手进,在线等关于XML问题
- 请问高手:如何使用NMFTP控件来取得远程服务器上的文件和目录列表,并判断哪些是目录,那些是文件?
- 请问如何让delphi2007中的memo控件能显示unicode编码的汉字呢?谢谢啊
- 本人编了一个小程序,不知该怎么网上推广?供大家下载请大家出出主意
- 200%结贴!ADSL虚拟拨号用户怎样才能有个固定的IP地址来共享FTP或WEB?
- 在delphi中如何使用动态SQL语句?
implementation
const
ScreenWidth: LongInt = 800; {I designed my form in 800x600 mode.}
ScreenHeight: LongInt = 600;{$R *.DFM}procedure TForm1.FormCreate(Sender: TObject);
begin
scaled := true;
if (screen.width <> ScreenWidth) then begin
height := longint(height) * longint(screen.height) DIV ScreenHeight;
width := longint(width) * longint(screen.width) DIV ScreenWidth;
scaleBy(screen.width, ScreenWidth);
end;
end;下面是解决字体大小的代码:
USES typinfo; {Add this to your USES statement.}var
i: integer;
begin
for i := componentCount - 1 downto 0 do
with components[i] do
begin
if GetPropInfo(ClassInfo, 'font') <> nil then
font.size := (NewFormWidth DIV OldFormWidth) * font.size;
end;
end;
写个系统配置文件,
分别保存在800*600和1024*768底下的各控件的位置属性(大小、位置等)。
在程序运行时,根据用户的分辨率来载入。最好最简单就是改用户的分辨率。不过在nt/2000/xp底下出了改分辨率,还要改刷新率,
不然会变为默认的60hz。要要的话,给个邮箱,我编个改用户分辨率和刷新率的demo给你发过去。