当然数据窗口的大小改变,数据窗口对象的各个字段位置及其大小也随着改变,
不知道怎样实现。先谢谢各位了。
11 个解决方案
#1
resize事件里写代码。
#2
我记得我曾经下载过一个源程序,回去帮你找找看。邮箱?
#3
Int li_index //循环变量
DragObject lobj_every //用来获得窗口上的控件
this.setredraw(false)
For li_index = 1 To UpperBound(this.control[]) //对窗口中的所有控件逐一处理
lobj_every = control[li_index] //保存当前控件
lobj_every.x = lobj_every.x * (newwidth/ii_width) //重新设置X坐标
lobj_every.width = lobj_every.width * (newwidth/ii_width) //重新设置宽度
lobj_every.y = lobj_every.y * (newheight/ii_height) //重新设置Y坐标
lobj_every.height = lobj_every.height * (newheight/ii_height) //重新设置高度
Next
ii_width = newwidth //保存当前宽度
ii_height = newheight //保存当前高度
this.setredraw(true)
DragObject lobj_every //用来获得窗口上的控件
this.setredraw(false)
For li_index = 1 To UpperBound(this.control[]) //对窗口中的所有控件逐一处理
lobj_every = control[li_index] //保存当前控件
lobj_every.x = lobj_every.x * (newwidth/ii_width) //重新设置X坐标
lobj_every.width = lobj_every.width * (newwidth/ii_width) //重新设置宽度
lobj_every.y = lobj_every.y * (newheight/ii_height) //重新设置Y坐标
lobj_every.height = lobj_every.height * (newheight/ii_height) //重新设置高度
Next
ii_width = newwidth //保存当前宽度
ii_height = newheight //保存当前高度
this.setredraw(true)
#4
上面的代码写在窗口的resize事件里
#5
resize中写代码
#6
告诉我你的mail,我发给你一个例子
#7
这个例子很实用,以后你直接可以使用这个窗口来进行继承了
#8
告诉我你的Email, 我这里有源代码,给你发过去,陶清写的
#9
lzp_lrp 你好,我的email是:zcyneu@sina.com.cn
多谢了!!
多谢了!!
#10
to oceanaut(海魂) and lzp_lrp(lzp) ;
能否发我一份,谢谢。
yl_yz@371.net
能否发我一份,谢谢。
yl_yz@371.net
#11
好的,以后发短信息
在窗口的Resize事件中这么写代码:
Integer li_i, li_width, li_count, li_height
Datawindow ldw_toolbar
UserObject luo_toolbar
For li_i = 1 To UpperBound ( Control )
if not isvalid(control[li_i]) then return
If Lower ( Control [ li_i ].ClassName ( ) ) = "cb_toolbar" Then
If Control [ li_i ].TypeOf ( ) = datawindow! Then
ldw_toolbar = Control [ li_i ]
li_width = This.WorkSpaceWidth ( )
ldw_toolbar.Width = li_width
Else
luo_toolbar = Control [ li_i ]
li_width = newwidth
luo_toolbar.Resize ( li_width , luo_toolbar.Height )
luo_toolbar.Dynamic Event ext_Resize ( )
End If
Exit
End If
Next
DragObject ldo_object
GraphicObject lgo_parent
UserObject luo_Parent
Window lw_parent
Datawindow ldw_object
li_count = UpperBound ( istr_position )
For li_i = 1 To li_count
// Get parent coordinate
ldo_object = istr_position [ li_i ].Object
lgo_parent = ldo_object.GetParent ( )
Choose Case lgo_parent.TypeOf ( )
Case Window!
lw_parent = lgo_parent
li_width = newwidth
li_height = newheight
Case UserObject!
luo_parent = lgo_parent
li_width = luo_parent.Width
li_height = luo_parent.Height
End Choose
If Lower ( istr_position [ li_i ].Object.ClassName ( ) ) = "cb_toolbar" Then continue
Choose Case istr_position [ li_i ].Method
Case "fixedtoright"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = istr_position [ li_i ].Object.Y
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtobottom"
li_width = istr_position [ li_i ].Object.X
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtoright&bottom"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "scaletoright"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = istr_position [ li_i ].Object.Height
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletobottom"
li_width = istr_position [ li_i ].Object.Width
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletoright&bottom"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "fixedtoright&scaletobottom"
Case "fixedtobottom&scaletoright"
End Choose
Next
再窗口中定义一函数
integer of_registerzoom(dragobject ado_source, string method)
内容为
// 使控件随窗口缩放
//
//"FixedToRight" or FIXEDRIGHT?
//"FixedToBottom" or FIXEDBOTTOM?
//"FixedToRight&Bottom" or FIXEDRIGHTBOTTOM?
//"Scale" or SCALE?
//"ScaleToRight" or SCALERIGHT?
//"ScaleToBottom" or SCALEBOTTOM?
//"ScaleToRight&Bottom" or SCALERIGHTBOTTOM?
//"FixedToRight&ScaleToBottom" or FIXEDRIGHT_SCALEBOTTOM?
//"FixedToBottom&ScaleToRight" or FIXEDBOTTOM_SCALERIGHT
PowerObject lpo_parent
Window lw_parent
UserObject luo_parent
Integer li_i
lpo_parent = ado_source.GetParent ( )
Integer li_parentwidth, li_parentheight, li_right, li_bottom
// 判断parent对象类型
Choose Case lpo_parent.typeOf ( )
Case Window!
lw_parent = lpo_parent
li_parentwidth = lw_parent.WorkSpaceWidth ( )
li_parentHeight = lw_parent.WorkSpaceHeight ( )
Case UserObject!
luo_parent = lpo_parent
li_parentWidth = luo_parent.Width
li_parentHeight = luo_parent.Height
End Choose
Method = Lower ( Method )
If Method <> "scaletobottom" And Method <> "fixedtoright" And Method <> "fixedtobottom"&
AND Method <> "fixedtoright&bottom" &
And Method <> "scaletoright" And Method <> "scaletobottom" And Method <> "scaletoright&bottom" &
And Method <> "FixedToRight&ScaleToBottom" And Method <> "FixedToBottom&ScaleToRight" Then
gnv_app.of_Message ( "程序设计错误:传入of_registerzoom参数出错!" )
Return -1
End If
li_right = li_parentWidth - ( ado_source.X + ado_source.Width )
li_bottom = li_parentheight - ( ado_source.Y + ado_source.Height )
li_i = UpperBound ( istr_position ) + 1
istr_position [ li_i ].left = ado_source.X
istr_position [ li_i ].Top = ado_source.Y
istr_position [ li_i ].object = ado_source
istr_position [ li_i ].right = li_right
istr_position [ li_i ].bottom = li_bottom
istr_position [ li_i ].method = Method
Return 1
在窗口的Open事件中这么写就行了
of_registerzoom(dw_1, "ScaleToRight&Bottom")即可
在窗口的Resize事件中这么写代码:
Integer li_i, li_width, li_count, li_height
Datawindow ldw_toolbar
UserObject luo_toolbar
For li_i = 1 To UpperBound ( Control )
if not isvalid(control[li_i]) then return
If Lower ( Control [ li_i ].ClassName ( ) ) = "cb_toolbar" Then
If Control [ li_i ].TypeOf ( ) = datawindow! Then
ldw_toolbar = Control [ li_i ]
li_width = This.WorkSpaceWidth ( )
ldw_toolbar.Width = li_width
Else
luo_toolbar = Control [ li_i ]
li_width = newwidth
luo_toolbar.Resize ( li_width , luo_toolbar.Height )
luo_toolbar.Dynamic Event ext_Resize ( )
End If
Exit
End If
Next
DragObject ldo_object
GraphicObject lgo_parent
UserObject luo_Parent
Window lw_parent
Datawindow ldw_object
li_count = UpperBound ( istr_position )
For li_i = 1 To li_count
// Get parent coordinate
ldo_object = istr_position [ li_i ].Object
lgo_parent = ldo_object.GetParent ( )
Choose Case lgo_parent.TypeOf ( )
Case Window!
lw_parent = lgo_parent
li_width = newwidth
li_height = newheight
Case UserObject!
luo_parent = lgo_parent
li_width = luo_parent.Width
li_height = luo_parent.Height
End Choose
If Lower ( istr_position [ li_i ].Object.ClassName ( ) ) = "cb_toolbar" Then continue
Choose Case istr_position [ li_i ].Method
Case "fixedtoright"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = istr_position [ li_i ].Object.Y
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtobottom"
li_width = istr_position [ li_i ].Object.X
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtoright&bottom"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "scaletoright"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = istr_position [ li_i ].Object.Height
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletobottom"
li_width = istr_position [ li_i ].Object.Width
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletoright&bottom"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "fixedtoright&scaletobottom"
Case "fixedtobottom&scaletoright"
End Choose
Next
再窗口中定义一函数
integer of_registerzoom(dragobject ado_source, string method)
内容为
// 使控件随窗口缩放
//
//"FixedToRight" or FIXEDRIGHT?
//"FixedToBottom" or FIXEDBOTTOM?
//"FixedToRight&Bottom" or FIXEDRIGHTBOTTOM?
//"Scale" or SCALE?
//"ScaleToRight" or SCALERIGHT?
//"ScaleToBottom" or SCALEBOTTOM?
//"ScaleToRight&Bottom" or SCALERIGHTBOTTOM?
//"FixedToRight&ScaleToBottom" or FIXEDRIGHT_SCALEBOTTOM?
//"FixedToBottom&ScaleToRight" or FIXEDBOTTOM_SCALERIGHT
PowerObject lpo_parent
Window lw_parent
UserObject luo_parent
Integer li_i
lpo_parent = ado_source.GetParent ( )
Integer li_parentwidth, li_parentheight, li_right, li_bottom
// 判断parent对象类型
Choose Case lpo_parent.typeOf ( )
Case Window!
lw_parent = lpo_parent
li_parentwidth = lw_parent.WorkSpaceWidth ( )
li_parentHeight = lw_parent.WorkSpaceHeight ( )
Case UserObject!
luo_parent = lpo_parent
li_parentWidth = luo_parent.Width
li_parentHeight = luo_parent.Height
End Choose
Method = Lower ( Method )
If Method <> "scaletobottom" And Method <> "fixedtoright" And Method <> "fixedtobottom"&
AND Method <> "fixedtoright&bottom" &
And Method <> "scaletoright" And Method <> "scaletobottom" And Method <> "scaletoright&bottom" &
And Method <> "FixedToRight&ScaleToBottom" And Method <> "FixedToBottom&ScaleToRight" Then
gnv_app.of_Message ( "程序设计错误:传入of_registerzoom参数出错!" )
Return -1
End If
li_right = li_parentWidth - ( ado_source.X + ado_source.Width )
li_bottom = li_parentheight - ( ado_source.Y + ado_source.Height )
li_i = UpperBound ( istr_position ) + 1
istr_position [ li_i ].left = ado_source.X
istr_position [ li_i ].Top = ado_source.Y
istr_position [ li_i ].object = ado_source
istr_position [ li_i ].right = li_right
istr_position [ li_i ].bottom = li_bottom
istr_position [ li_i ].method = Method
Return 1
在窗口的Open事件中这么写就行了
of_registerzoom(dw_1, "ScaleToRight&Bottom")即可
#1
resize事件里写代码。
#2
我记得我曾经下载过一个源程序,回去帮你找找看。邮箱?
#3
Int li_index //循环变量
DragObject lobj_every //用来获得窗口上的控件
this.setredraw(false)
For li_index = 1 To UpperBound(this.control[]) //对窗口中的所有控件逐一处理
lobj_every = control[li_index] //保存当前控件
lobj_every.x = lobj_every.x * (newwidth/ii_width) //重新设置X坐标
lobj_every.width = lobj_every.width * (newwidth/ii_width) //重新设置宽度
lobj_every.y = lobj_every.y * (newheight/ii_height) //重新设置Y坐标
lobj_every.height = lobj_every.height * (newheight/ii_height) //重新设置高度
Next
ii_width = newwidth //保存当前宽度
ii_height = newheight //保存当前高度
this.setredraw(true)
DragObject lobj_every //用来获得窗口上的控件
this.setredraw(false)
For li_index = 1 To UpperBound(this.control[]) //对窗口中的所有控件逐一处理
lobj_every = control[li_index] //保存当前控件
lobj_every.x = lobj_every.x * (newwidth/ii_width) //重新设置X坐标
lobj_every.width = lobj_every.width * (newwidth/ii_width) //重新设置宽度
lobj_every.y = lobj_every.y * (newheight/ii_height) //重新设置Y坐标
lobj_every.height = lobj_every.height * (newheight/ii_height) //重新设置高度
Next
ii_width = newwidth //保存当前宽度
ii_height = newheight //保存当前高度
this.setredraw(true)
#4
上面的代码写在窗口的resize事件里
#5
resize中写代码
#6
告诉我你的mail,我发给你一个例子
#7
这个例子很实用,以后你直接可以使用这个窗口来进行继承了
#8
告诉我你的Email, 我这里有源代码,给你发过去,陶清写的
#9
lzp_lrp 你好,我的email是:zcyneu@sina.com.cn
多谢了!!
多谢了!!
#10
to oceanaut(海魂) and lzp_lrp(lzp) ;
能否发我一份,谢谢。
yl_yz@371.net
能否发我一份,谢谢。
yl_yz@371.net
#11
好的,以后发短信息
在窗口的Resize事件中这么写代码:
Integer li_i, li_width, li_count, li_height
Datawindow ldw_toolbar
UserObject luo_toolbar
For li_i = 1 To UpperBound ( Control )
if not isvalid(control[li_i]) then return
If Lower ( Control [ li_i ].ClassName ( ) ) = "cb_toolbar" Then
If Control [ li_i ].TypeOf ( ) = datawindow! Then
ldw_toolbar = Control [ li_i ]
li_width = This.WorkSpaceWidth ( )
ldw_toolbar.Width = li_width
Else
luo_toolbar = Control [ li_i ]
li_width = newwidth
luo_toolbar.Resize ( li_width , luo_toolbar.Height )
luo_toolbar.Dynamic Event ext_Resize ( )
End If
Exit
End If
Next
DragObject ldo_object
GraphicObject lgo_parent
UserObject luo_Parent
Window lw_parent
Datawindow ldw_object
li_count = UpperBound ( istr_position )
For li_i = 1 To li_count
// Get parent coordinate
ldo_object = istr_position [ li_i ].Object
lgo_parent = ldo_object.GetParent ( )
Choose Case lgo_parent.TypeOf ( )
Case Window!
lw_parent = lgo_parent
li_width = newwidth
li_height = newheight
Case UserObject!
luo_parent = lgo_parent
li_width = luo_parent.Width
li_height = luo_parent.Height
End Choose
If Lower ( istr_position [ li_i ].Object.ClassName ( ) ) = "cb_toolbar" Then continue
Choose Case istr_position [ li_i ].Method
Case "fixedtoright"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = istr_position [ li_i ].Object.Y
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtobottom"
li_width = istr_position [ li_i ].Object.X
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtoright&bottom"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "scaletoright"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = istr_position [ li_i ].Object.Height
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletobottom"
li_width = istr_position [ li_i ].Object.Width
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletoright&bottom"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "fixedtoright&scaletobottom"
Case "fixedtobottom&scaletoright"
End Choose
Next
再窗口中定义一函数
integer of_registerzoom(dragobject ado_source, string method)
内容为
// 使控件随窗口缩放
//
//"FixedToRight" or FIXEDRIGHT?
//"FixedToBottom" or FIXEDBOTTOM?
//"FixedToRight&Bottom" or FIXEDRIGHTBOTTOM?
//"Scale" or SCALE?
//"ScaleToRight" or SCALERIGHT?
//"ScaleToBottom" or SCALEBOTTOM?
//"ScaleToRight&Bottom" or SCALERIGHTBOTTOM?
//"FixedToRight&ScaleToBottom" or FIXEDRIGHT_SCALEBOTTOM?
//"FixedToBottom&ScaleToRight" or FIXEDBOTTOM_SCALERIGHT
PowerObject lpo_parent
Window lw_parent
UserObject luo_parent
Integer li_i
lpo_parent = ado_source.GetParent ( )
Integer li_parentwidth, li_parentheight, li_right, li_bottom
// 判断parent对象类型
Choose Case lpo_parent.typeOf ( )
Case Window!
lw_parent = lpo_parent
li_parentwidth = lw_parent.WorkSpaceWidth ( )
li_parentHeight = lw_parent.WorkSpaceHeight ( )
Case UserObject!
luo_parent = lpo_parent
li_parentWidth = luo_parent.Width
li_parentHeight = luo_parent.Height
End Choose
Method = Lower ( Method )
If Method <> "scaletobottom" And Method <> "fixedtoright" And Method <> "fixedtobottom"&
AND Method <> "fixedtoright&bottom" &
And Method <> "scaletoright" And Method <> "scaletobottom" And Method <> "scaletoright&bottom" &
And Method <> "FixedToRight&ScaleToBottom" And Method <> "FixedToBottom&ScaleToRight" Then
gnv_app.of_Message ( "程序设计错误:传入of_registerzoom参数出错!" )
Return -1
End If
li_right = li_parentWidth - ( ado_source.X + ado_source.Width )
li_bottom = li_parentheight - ( ado_source.Y + ado_source.Height )
li_i = UpperBound ( istr_position ) + 1
istr_position [ li_i ].left = ado_source.X
istr_position [ li_i ].Top = ado_source.Y
istr_position [ li_i ].object = ado_source
istr_position [ li_i ].right = li_right
istr_position [ li_i ].bottom = li_bottom
istr_position [ li_i ].method = Method
Return 1
在窗口的Open事件中这么写就行了
of_registerzoom(dw_1, "ScaleToRight&Bottom")即可
在窗口的Resize事件中这么写代码:
Integer li_i, li_width, li_count, li_height
Datawindow ldw_toolbar
UserObject luo_toolbar
For li_i = 1 To UpperBound ( Control )
if not isvalid(control[li_i]) then return
If Lower ( Control [ li_i ].ClassName ( ) ) = "cb_toolbar" Then
If Control [ li_i ].TypeOf ( ) = datawindow! Then
ldw_toolbar = Control [ li_i ]
li_width = This.WorkSpaceWidth ( )
ldw_toolbar.Width = li_width
Else
luo_toolbar = Control [ li_i ]
li_width = newwidth
luo_toolbar.Resize ( li_width , luo_toolbar.Height )
luo_toolbar.Dynamic Event ext_Resize ( )
End If
Exit
End If
Next
DragObject ldo_object
GraphicObject lgo_parent
UserObject luo_Parent
Window lw_parent
Datawindow ldw_object
li_count = UpperBound ( istr_position )
For li_i = 1 To li_count
// Get parent coordinate
ldo_object = istr_position [ li_i ].Object
lgo_parent = ldo_object.GetParent ( )
Choose Case lgo_parent.TypeOf ( )
Case Window!
lw_parent = lgo_parent
li_width = newwidth
li_height = newheight
Case UserObject!
luo_parent = lgo_parent
li_width = luo_parent.Width
li_height = luo_parent.Height
End Choose
If Lower ( istr_position [ li_i ].Object.ClassName ( ) ) = "cb_toolbar" Then continue
Choose Case istr_position [ li_i ].Method
Case "fixedtoright"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = istr_position [ li_i ].Object.Y
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtobottom"
li_width = istr_position [ li_i ].Object.X
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "fixedtoright&bottom"
li_width = li_width - istr_position [ li_i ].right - istr_position [ li_i ].Object.Width
li_height = li_height - istr_position [ li_i ].bottom - istr_position [ li_i ].Object.Height
istr_position [ li_i ].Object.Move ( li_width, li_height )
Case "scaletoright"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = istr_position [ li_i ].Object.Height
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletobottom"
li_width = istr_position [ li_i ].Object.Width
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "scaletoright&bottom"
li_width = li_width - ( istr_position [ li_i ].Left + istr_position [ li_i ].right )
li_height = li_height - ( istr_position [ li_i ].Top + istr_position [ li_i ].Bottom )
istr_position [li_i].Object.Resize ( li_width, li_height )
Case "fixedtoright&scaletobottom"
Case "fixedtobottom&scaletoright"
End Choose
Next
再窗口中定义一函数
integer of_registerzoom(dragobject ado_source, string method)
内容为
// 使控件随窗口缩放
//
//"FixedToRight" or FIXEDRIGHT?
//"FixedToBottom" or FIXEDBOTTOM?
//"FixedToRight&Bottom" or FIXEDRIGHTBOTTOM?
//"Scale" or SCALE?
//"ScaleToRight" or SCALERIGHT?
//"ScaleToBottom" or SCALEBOTTOM?
//"ScaleToRight&Bottom" or SCALERIGHTBOTTOM?
//"FixedToRight&ScaleToBottom" or FIXEDRIGHT_SCALEBOTTOM?
//"FixedToBottom&ScaleToRight" or FIXEDBOTTOM_SCALERIGHT
PowerObject lpo_parent
Window lw_parent
UserObject luo_parent
Integer li_i
lpo_parent = ado_source.GetParent ( )
Integer li_parentwidth, li_parentheight, li_right, li_bottom
// 判断parent对象类型
Choose Case lpo_parent.typeOf ( )
Case Window!
lw_parent = lpo_parent
li_parentwidth = lw_parent.WorkSpaceWidth ( )
li_parentHeight = lw_parent.WorkSpaceHeight ( )
Case UserObject!
luo_parent = lpo_parent
li_parentWidth = luo_parent.Width
li_parentHeight = luo_parent.Height
End Choose
Method = Lower ( Method )
If Method <> "scaletobottom" And Method <> "fixedtoright" And Method <> "fixedtobottom"&
AND Method <> "fixedtoright&bottom" &
And Method <> "scaletoright" And Method <> "scaletobottom" And Method <> "scaletoright&bottom" &
And Method <> "FixedToRight&ScaleToBottom" And Method <> "FixedToBottom&ScaleToRight" Then
gnv_app.of_Message ( "程序设计错误:传入of_registerzoom参数出错!" )
Return -1
End If
li_right = li_parentWidth - ( ado_source.X + ado_source.Width )
li_bottom = li_parentheight - ( ado_source.Y + ado_source.Height )
li_i = UpperBound ( istr_position ) + 1
istr_position [ li_i ].left = ado_source.X
istr_position [ li_i ].Top = ado_source.Y
istr_position [ li_i ].object = ado_source
istr_position [ li_i ].right = li_right
istr_position [ li_i ].bottom = li_bottom
istr_position [ li_i ].method = Method
Return 1
在窗口的Open事件中这么写就行了
of_registerzoom(dw_1, "ScaleToRight&Bottom")即可