10 个解决方案
#1
你再resize里控制窗体上控件的大小
#2
你在窗口的resize事件里面写代码:
给你这段代码:
//===================================
// 重新设置控件布局
//===================================
Integer i, li_control, li_MarginX, li_MarginY
String ls_move, ls_resize
DragObject ldrag_object,ldrag_parent,ldrag_tmp
If Not(This.WindowType = MDI! Or This.WindowType = MDIHelp!) Then
li_control = inv_control.Of_GetControlCount()
For i = 1 to li_control
ldrag_object = inv_control.of_GetControl(i)
ls_move = inv_control.of_GetMove(i)
ls_resize = inv_control.of_GetResize(i)
li_MarginX = inv_control.of_GetMarginX(i)
li_MarginY = inv_control.of_GetMarginY(i)
IF ldrag_object.GetParent().ClassName() = This.ClassName() THEN
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, This.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, This.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, This.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, This.height - li_MarginY - ldrag_object.y)
END CHOOSE
ELSE
ldrag_parent = ldrag_object.GetParent()
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.y)
END CHOOSE
END IF
Next
End if
If This.width < il_MinWidth Then
This.width = il_MinWidth
End if
If This.Height < il_MinHeight Then
This.height = il_MinHeight
End if
我们一直用的,你考进去就行了。
给你这段代码:
//===================================
// 重新设置控件布局
//===================================
Integer i, li_control, li_MarginX, li_MarginY
String ls_move, ls_resize
DragObject ldrag_object,ldrag_parent,ldrag_tmp
If Not(This.WindowType = MDI! Or This.WindowType = MDIHelp!) Then
li_control = inv_control.Of_GetControlCount()
For i = 1 to li_control
ldrag_object = inv_control.of_GetControl(i)
ls_move = inv_control.of_GetMove(i)
ls_resize = inv_control.of_GetResize(i)
li_MarginX = inv_control.of_GetMarginX(i)
li_MarginY = inv_control.of_GetMarginY(i)
IF ldrag_object.GetParent().ClassName() = This.ClassName() THEN
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, This.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, This.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, This.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, This.height - li_MarginY - ldrag_object.y)
END CHOOSE
ELSE
ldrag_parent = ldrag_object.GetParent()
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.y)
END CHOOSE
END IF
Next
End if
If This.width < il_MinWidth Then
This.width = il_MinWidth
End if
If This.Height < il_MinHeight Then
This.height = il_MinHeight
End if
我们一直用的,你考进去就行了。
#3
汗,不好意思,忘记把底层函数给你了。抱歉,你还是不能用。
#4
pre_open()
#5
2楼正解。
在窗体preopen 事件中 用Resize
在窗体preopen 事件中 用Resize
#6
$PBExportHeader$f_windowscreen.srf
$PBExportComments$根据不同分辨率改变窗口和控件大小,以及字体大小。参数:窗口名,开发环境分辨率。如:f_windowscreen(this,1024,768)
global type f_windowscreen from function_object
end type
forward prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary)
end prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary);environment env
int ii_Screenwidth,ii_Screenheight
double WRadio,HRadio,Radio
int ii_WinBolderwidth,ii_WinBolderheight
getenvironment(env)
ii_WinBolderwidth=arwin.width - arwin.workspacewidth()//取得窗体边框的宽度
ii_WinBolderheight=arwin.height - arwin.workspaceheight()
ii_Screenwidth=env.screenwidth
ii_Screenheight=env.screenheight
//************************************************************************//
//获取需要调整的计算机分辨率**********************************************//
WRadio=ii_Screenwidth/arx //标准认为屏幕分辨率为arx*ary
HRadio=ii_Screenheight/ary//计算出屏幕相对arx*ary分辨率的变化
Radio=min(WRadio,HRadio)
if Radio=1.0 then //如果分辨率是arx*ary
return 0
end if
if (arwin.WindowType=MDIHelp!) or (arwin.WindowType=MDI!) then
arwin.resize(arwin.workspacewidth()*Radio,arwin.workspaceheight()*Radio)
return 0
else
arwin.hide()
arwin.width=(arwin.width - ii_WinBolderwidth)*Radio + ii_WinBolderwidth
arwin.height=(arwin.height - ii_WinBolderheight)*Radio + ii_WinBolderheight
int i
dragobject temp//用于取各种控件
windowobject song[]
song[]=arwin.control[]
for i=1 to upperbound(song)
temp=arwin.control[i]//调整控件大小和位置
temp.width=temp.width*Radio
temp.x=temp.x*Radio
temp.height=temp.height*Radio
temp.y=temp.y*Radio
choose case typeof(temp)
case tab!
tab mtab
mtab=temp
mtab.textsize=mtab.textsize*Radio//设置字体大小
case commandbutton!
commandbutton cb
cb=temp
cb.textsize=cb.textsize*Radio
case singlelineedit!
singlelineedit sle
sle=temp
sle.textsize=sle.textsize*Radio
case editmask!
editmask em
em=temp
em.textsize=em.textsize*Radio
case statictext!
statictext st
st=temp
st.textsize=st.textsize*Radio
case datawindow!//get datawindow zoomen
datawindow dw
dw=temp
dw.object.datawindow.zoom=string(int(Radio*100))//注意datawindow和其他控件的不同。
case picturebutton!
picturebutton pb
pb=temp
pb.textsize=pb.textsize*Radio
case checkbox!
checkbox cbx
cbx=temp
cbx.textsize=cbx.textsize*Radio
case dropdownlistbox!
dropdownlistbox ddlb
ddlb=temp
ddlb.textsize=ddlb.textsize*Radio
case groupbox!
groupbox gb
gb=temp
gb.textsize=gb.textsize*Radio
case listbox!
listbox lb
lb=temp
lb.textsize=lb.textsize*Radio
case multilineedit!
multilineedit mle
mle=temp
mle.textsize=mle.textsize*Radio
case radiobutton!
radiobutton rb
rb=temp
rb.textsize=rb.textsize*Radio
end choose
next
arwin.show()
return 0
end if
end function
将上面这些代码存成rtf文档导入后调用试试
$PBExportComments$根据不同分辨率改变窗口和控件大小,以及字体大小。参数:窗口名,开发环境分辨率。如:f_windowscreen(this,1024,768)
global type f_windowscreen from function_object
end type
forward prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary)
end prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary);environment env
int ii_Screenwidth,ii_Screenheight
double WRadio,HRadio,Radio
int ii_WinBolderwidth,ii_WinBolderheight
getenvironment(env)
ii_WinBolderwidth=arwin.width - arwin.workspacewidth()//取得窗体边框的宽度
ii_WinBolderheight=arwin.height - arwin.workspaceheight()
ii_Screenwidth=env.screenwidth
ii_Screenheight=env.screenheight
//************************************************************************//
//获取需要调整的计算机分辨率**********************************************//
WRadio=ii_Screenwidth/arx //标准认为屏幕分辨率为arx*ary
HRadio=ii_Screenheight/ary//计算出屏幕相对arx*ary分辨率的变化
Radio=min(WRadio,HRadio)
if Radio=1.0 then //如果分辨率是arx*ary
return 0
end if
if (arwin.WindowType=MDIHelp!) or (arwin.WindowType=MDI!) then
arwin.resize(arwin.workspacewidth()*Radio,arwin.workspaceheight()*Radio)
return 0
else
arwin.hide()
arwin.width=(arwin.width - ii_WinBolderwidth)*Radio + ii_WinBolderwidth
arwin.height=(arwin.height - ii_WinBolderheight)*Radio + ii_WinBolderheight
int i
dragobject temp//用于取各种控件
windowobject song[]
song[]=arwin.control[]
for i=1 to upperbound(song)
temp=arwin.control[i]//调整控件大小和位置
temp.width=temp.width*Radio
temp.x=temp.x*Radio
temp.height=temp.height*Radio
temp.y=temp.y*Radio
choose case typeof(temp)
case tab!
tab mtab
mtab=temp
mtab.textsize=mtab.textsize*Radio//设置字体大小
case commandbutton!
commandbutton cb
cb=temp
cb.textsize=cb.textsize*Radio
case singlelineedit!
singlelineedit sle
sle=temp
sle.textsize=sle.textsize*Radio
case editmask!
editmask em
em=temp
em.textsize=em.textsize*Radio
case statictext!
statictext st
st=temp
st.textsize=st.textsize*Radio
case datawindow!//get datawindow zoomen
datawindow dw
dw=temp
dw.object.datawindow.zoom=string(int(Radio*100))//注意datawindow和其他控件的不同。
case picturebutton!
picturebutton pb
pb=temp
pb.textsize=pb.textsize*Radio
case checkbox!
checkbox cbx
cbx=temp
cbx.textsize=cbx.textsize*Radio
case dropdownlistbox!
dropdownlistbox ddlb
ddlb=temp
ddlb.textsize=ddlb.textsize*Radio
case groupbox!
groupbox gb
gb=temp
gb.textsize=gb.textsize*Radio
case listbox!
listbox lb
lb=temp
lb.textsize=lb.textsize*Radio
case multilineedit!
multilineedit mle
mle=temp
mle.textsize=mle.textsize*Radio
case radiobutton!
radiobutton rb
rb=temp
rb.textsize=rb.textsize*Radio
end choose
next
arwin.show()
return 0
end if
end function
将上面这些代码存成rtf文档导入后调用试试
#7
resize事件 处理
#8
PFC里有一个服务,在window 改变大小时,同时改变控件的大小,具体名称忘记了。你有兴趣可以去查查,基本上拿来就可以使用。
里面有N个函数,可以设定控件保持哪个方向大小不向,仅仅往哪个方向变形,比较好用,用的时候在resize事件里写几行代码就可以了
里面有N个函数,可以设定控件保持哪个方向大小不向,仅仅往哪个方向变形,比较好用,用的时候在resize事件里写几行代码就可以了
#9
顶一个,需要自己写的,resize
#10
经常写resize事件写到吐血的路过~~
#1
你再resize里控制窗体上控件的大小
#2
你在窗口的resize事件里面写代码:
给你这段代码:
//===================================
// 重新设置控件布局
//===================================
Integer i, li_control, li_MarginX, li_MarginY
String ls_move, ls_resize
DragObject ldrag_object,ldrag_parent,ldrag_tmp
If Not(This.WindowType = MDI! Or This.WindowType = MDIHelp!) Then
li_control = inv_control.Of_GetControlCount()
For i = 1 to li_control
ldrag_object = inv_control.of_GetControl(i)
ls_move = inv_control.of_GetMove(i)
ls_resize = inv_control.of_GetResize(i)
li_MarginX = inv_control.of_GetMarginX(i)
li_MarginY = inv_control.of_GetMarginY(i)
IF ldrag_object.GetParent().ClassName() = This.ClassName() THEN
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, This.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, This.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, This.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, This.height - li_MarginY - ldrag_object.y)
END CHOOSE
ELSE
ldrag_parent = ldrag_object.GetParent()
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.y)
END CHOOSE
END IF
Next
End if
If This.width < il_MinWidth Then
This.width = il_MinWidth
End if
If This.Height < il_MinHeight Then
This.height = il_MinHeight
End if
我们一直用的,你考进去就行了。
给你这段代码:
//===================================
// 重新设置控件布局
//===================================
Integer i, li_control, li_MarginX, li_MarginY
String ls_move, ls_resize
DragObject ldrag_object,ldrag_parent,ldrag_tmp
If Not(This.WindowType = MDI! Or This.WindowType = MDIHelp!) Then
li_control = inv_control.Of_GetControlCount()
For i = 1 to li_control
ldrag_object = inv_control.of_GetControl(i)
ls_move = inv_control.of_GetMove(i)
ls_resize = inv_control.of_GetResize(i)
li_MarginX = inv_control.of_GetMarginX(i)
li_MarginY = inv_control.of_GetMarginY(i)
IF ldrag_object.GetParent().ClassName() = This.ClassName() THEN
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, This.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(This.width - li_MarginX - ldrag_object.width, This.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, This.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(This.width - li_MarginX - ldrag_object.x, This.height - li_MarginY - ldrag_object.y)
END CHOOSE
ELSE
ldrag_parent = ldrag_object.GetParent()
CHOOSE CASE Upper(ls_move)
CASE 'RIGHT'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_object.y)
CASE 'BOTTOM'
ldrag_object.Move(ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.height)
CASE 'BOTH'
ldrag_object.Move(ldrag_parent.width - li_MarginX - ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.height)
END CHOOSE
CHOOSE CASE Upper(ls_resize)
CASE 'RIGHT'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_object.height)
CASE 'BOTTOM'
ldrag_object.Resize(ldrag_object.width, ldrag_parent.height - li_MarginY - ldrag_object.y)
CASE 'BOTH'
ldrag_object.Resize(ldrag_parent.width - li_MarginX - ldrag_object.x, ldrag_parent.height - li_MarginY - ldrag_object.y)
END CHOOSE
END IF
Next
End if
If This.width < il_MinWidth Then
This.width = il_MinWidth
End if
If This.Height < il_MinHeight Then
This.height = il_MinHeight
End if
我们一直用的,你考进去就行了。
#3
汗,不好意思,忘记把底层函数给你了。抱歉,你还是不能用。
#4
pre_open()
#5
2楼正解。
在窗体preopen 事件中 用Resize
在窗体preopen 事件中 用Resize
#6
$PBExportHeader$f_windowscreen.srf
$PBExportComments$根据不同分辨率改变窗口和控件大小,以及字体大小。参数:窗口名,开发环境分辨率。如:f_windowscreen(this,1024,768)
global type f_windowscreen from function_object
end type
forward prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary)
end prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary);environment env
int ii_Screenwidth,ii_Screenheight
double WRadio,HRadio,Radio
int ii_WinBolderwidth,ii_WinBolderheight
getenvironment(env)
ii_WinBolderwidth=arwin.width - arwin.workspacewidth()//取得窗体边框的宽度
ii_WinBolderheight=arwin.height - arwin.workspaceheight()
ii_Screenwidth=env.screenwidth
ii_Screenheight=env.screenheight
//************************************************************************//
//获取需要调整的计算机分辨率**********************************************//
WRadio=ii_Screenwidth/arx //标准认为屏幕分辨率为arx*ary
HRadio=ii_Screenheight/ary//计算出屏幕相对arx*ary分辨率的变化
Radio=min(WRadio,HRadio)
if Radio=1.0 then //如果分辨率是arx*ary
return 0
end if
if (arwin.WindowType=MDIHelp!) or (arwin.WindowType=MDI!) then
arwin.resize(arwin.workspacewidth()*Radio,arwin.workspaceheight()*Radio)
return 0
else
arwin.hide()
arwin.width=(arwin.width - ii_WinBolderwidth)*Radio + ii_WinBolderwidth
arwin.height=(arwin.height - ii_WinBolderheight)*Radio + ii_WinBolderheight
int i
dragobject temp//用于取各种控件
windowobject song[]
song[]=arwin.control[]
for i=1 to upperbound(song)
temp=arwin.control[i]//调整控件大小和位置
temp.width=temp.width*Radio
temp.x=temp.x*Radio
temp.height=temp.height*Radio
temp.y=temp.y*Radio
choose case typeof(temp)
case tab!
tab mtab
mtab=temp
mtab.textsize=mtab.textsize*Radio//设置字体大小
case commandbutton!
commandbutton cb
cb=temp
cb.textsize=cb.textsize*Radio
case singlelineedit!
singlelineedit sle
sle=temp
sle.textsize=sle.textsize*Radio
case editmask!
editmask em
em=temp
em.textsize=em.textsize*Radio
case statictext!
statictext st
st=temp
st.textsize=st.textsize*Radio
case datawindow!//get datawindow zoomen
datawindow dw
dw=temp
dw.object.datawindow.zoom=string(int(Radio*100))//注意datawindow和其他控件的不同。
case picturebutton!
picturebutton pb
pb=temp
pb.textsize=pb.textsize*Radio
case checkbox!
checkbox cbx
cbx=temp
cbx.textsize=cbx.textsize*Radio
case dropdownlistbox!
dropdownlistbox ddlb
ddlb=temp
ddlb.textsize=ddlb.textsize*Radio
case groupbox!
groupbox gb
gb=temp
gb.textsize=gb.textsize*Radio
case listbox!
listbox lb
lb=temp
lb.textsize=lb.textsize*Radio
case multilineedit!
multilineedit mle
mle=temp
mle.textsize=mle.textsize*Radio
case radiobutton!
radiobutton rb
rb=temp
rb.textsize=rb.textsize*Radio
end choose
next
arwin.show()
return 0
end if
end function
将上面这些代码存成rtf文档导入后调用试试
$PBExportComments$根据不同分辨率改变窗口和控件大小,以及字体大小。参数:窗口名,开发环境分辨率。如:f_windowscreen(this,1024,768)
global type f_windowscreen from function_object
end type
forward prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary)
end prototypes
global function integer f_windowscreen (readonly window arwin, integer arx, integer ary);environment env
int ii_Screenwidth,ii_Screenheight
double WRadio,HRadio,Radio
int ii_WinBolderwidth,ii_WinBolderheight
getenvironment(env)
ii_WinBolderwidth=arwin.width - arwin.workspacewidth()//取得窗体边框的宽度
ii_WinBolderheight=arwin.height - arwin.workspaceheight()
ii_Screenwidth=env.screenwidth
ii_Screenheight=env.screenheight
//************************************************************************//
//获取需要调整的计算机分辨率**********************************************//
WRadio=ii_Screenwidth/arx //标准认为屏幕分辨率为arx*ary
HRadio=ii_Screenheight/ary//计算出屏幕相对arx*ary分辨率的变化
Radio=min(WRadio,HRadio)
if Radio=1.0 then //如果分辨率是arx*ary
return 0
end if
if (arwin.WindowType=MDIHelp!) or (arwin.WindowType=MDI!) then
arwin.resize(arwin.workspacewidth()*Radio,arwin.workspaceheight()*Radio)
return 0
else
arwin.hide()
arwin.width=(arwin.width - ii_WinBolderwidth)*Radio + ii_WinBolderwidth
arwin.height=(arwin.height - ii_WinBolderheight)*Radio + ii_WinBolderheight
int i
dragobject temp//用于取各种控件
windowobject song[]
song[]=arwin.control[]
for i=1 to upperbound(song)
temp=arwin.control[i]//调整控件大小和位置
temp.width=temp.width*Radio
temp.x=temp.x*Radio
temp.height=temp.height*Radio
temp.y=temp.y*Radio
choose case typeof(temp)
case tab!
tab mtab
mtab=temp
mtab.textsize=mtab.textsize*Radio//设置字体大小
case commandbutton!
commandbutton cb
cb=temp
cb.textsize=cb.textsize*Radio
case singlelineedit!
singlelineedit sle
sle=temp
sle.textsize=sle.textsize*Radio
case editmask!
editmask em
em=temp
em.textsize=em.textsize*Radio
case statictext!
statictext st
st=temp
st.textsize=st.textsize*Radio
case datawindow!//get datawindow zoomen
datawindow dw
dw=temp
dw.object.datawindow.zoom=string(int(Radio*100))//注意datawindow和其他控件的不同。
case picturebutton!
picturebutton pb
pb=temp
pb.textsize=pb.textsize*Radio
case checkbox!
checkbox cbx
cbx=temp
cbx.textsize=cbx.textsize*Radio
case dropdownlistbox!
dropdownlistbox ddlb
ddlb=temp
ddlb.textsize=ddlb.textsize*Radio
case groupbox!
groupbox gb
gb=temp
gb.textsize=gb.textsize*Radio
case listbox!
listbox lb
lb=temp
lb.textsize=lb.textsize*Radio
case multilineedit!
multilineedit mle
mle=temp
mle.textsize=mle.textsize*Radio
case radiobutton!
radiobutton rb
rb=temp
rb.textsize=rb.textsize*Radio
end choose
next
arwin.show()
return 0
end if
end function
将上面这些代码存成rtf文档导入后调用试试
#7
resize事件 处理
#8
PFC里有一个服务,在window 改变大小时,同时改变控件的大小,具体名称忘记了。你有兴趣可以去查查,基本上拿来就可以使用。
里面有N个函数,可以设定控件保持哪个方向大小不向,仅仅往哪个方向变形,比较好用,用的时候在resize事件里写几行代码就可以了
里面有N个函数,可以设定控件保持哪个方向大小不向,仅仅往哪个方向变形,比较好用,用的时候在resize事件里写几行代码就可以了
#9
顶一个,需要自己写的,resize
#10
经常写resize事件写到吐血的路过~~