新建一个空白窗体(window)在自定义事件里定义名为ue_getScale的事件
入口参数None返回值None 事件ID为None
事件内容
//获取控件与窗口比例大小
int li_i
DragObject wnd
for li_i = upperBound(Control[]) to step
wnd = control[li_i]
id_scaleX[li_i] = wndX / width
id_scaleY[li_i] = wndY / height
id_scaleWidth[li_i] = wndwidth / width
id_scaleHeight[li_i] = wndheight / height
next
在resize事件里写入如下代码
int li_i li_count
DragObject w_object
if sizeType = then return //最小化窗口不处理
li_count = upperBound(id_scaleX[])
if li_count < then return
SetRedraw(false)
for li_i = to li_count
w_object = control[li_i]
w_objectX = ceiling(width * id_scaleX[li_i])
w_objectY = ceiling(height * id_scaleY[li_i])
w_objectwidth = ceiling(width * id_scaleWidth[li_i])
w_objectheight = ceiling(height * id_scaleHeight[li_i])
next
SetRedraw(true)
最后在Open事件里触发Ue_getScale()事件就可以了
备注对DataWindow和OLE控件效果不是很好
编辑推荐
ASP NET开发培训视频教程
Microsoft NET框架程序设计视频教程