自动调整屏幕大小.doc

上传人:scccc 文档编号:14627487 上传时间:2022-02-10 格式:DOC 页数:2 大小:16KB
返回 下载 相关 举报
自动调整屏幕大小.doc_第1页
第1页 / 共2页
自动调整屏幕大小.doc_第2页
第2页 / 共2页
亲,该文档总共2页,全部预览完了,如果喜欢就下载吧!
资源描述

《自动调整屏幕大小.doc》由会员分享,可在线阅读,更多相关《自动调整屏幕大小.doc(2页珍藏版)》请在三一文库上搜索。

1、自动调整屏幕大小*- 函数 sysmetric(n)*- 参数含义及返回值* 1 当前屏幕宽度* 2 当前屏幕高度*- 如果当前屏幕的宽度不是预先在设计模式下设定的宽 度,则进行对表单上控件的自动调整*- 注释 : _DesignWidth 和 _DesignHeight 是人为设定的程 序运行的默认窗口大小IF SYSMETRIC(1) This._DesignWidth#DEFINE nHeightFactor SYSMETRIC(2) / This._DesignHeight& 默认为 480#DEFINE nWidthFactor SYSMETRIC(1) / This._Design

2、Width& 默认为 640WITH THIS*- 重新调整表单的大小和位置.Width = .Width * nWidthFactor.Height = .Height * nHeightFactor.Left = .Left * nWidthFactor .Top = .Top * nHeightFactor*- 重新调整表单上的控件的大小和位置 FOR nControlLoop = 1 TO .ControlCount .ControlsnControlLoop.Width= .ControlsnControlLoop.Width * nWidthFactor .ControlsnCon

3、trolLoop.Height= .ControlsnControlLoop.Height * nHeightFactor .ControlsnControlLoop.Left = .ControlsnControlLoop.Left * nWidthFactor.ControlsnControlLoop.Top = .ControlsnControlLoop.Top * nHeightFactor*- 调整控件字体大小IF PEMSTATUS(.ControlsnControlLoop,FontSize,5) .ControlsnControlLoop.FontSize =INT(.ControlsnControlLoop.FontSize * nHeightFactor) ENDIFENDFORENDWITHENDIF将上述代码放在表单的 INIT 事件是有用的,若将This._DesignWidth 改为 640,将 This._DesignHeight 改为 480, 设 AUTOCENTER=.f. 效果非常明显

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1