这个方法错在呢?
CLEAR ALLCLOSE PROCEDURES
SET PROCEDURE TO "MyFormClass", "MyLoginForm"&&,"otherForm"
runShouliaoForm()
CLOSE PROCEDURES
&&CLOSE ALL
return
PROCEDURE runShouliaoForm
PUBLIC shouliaoForm
shouliaoForm=CREATEOBJECT("m1Form")
shouliaoForm.show
READ EVENTS
RETURN
ENDPROC
DEFINE CLASS m1Form as myForm
showWindow=2
caption="功能1——收料单"
autoCenter=.t.
windowType=1
beforeWidth=this.width
currWidth=this.width
beforeHeight=this.Height
currHeight=this.Height
minWidth=this.Width
minHeight=this.Height
rowStep=1
colStep=1
formHeightZoom=1
formWidthZoom=1
ADD OBJECT titleLabel1 as label WITH caption="收 料 单",backColor=RGB(222,222,222)
PROCEDURE Arrange
LOCAL tempFormWidth,tempFormHeight
tempFormWidth=this.width
tempFormHeight=this.height
IF (this.beforeWidth<>tempFormWidth) .or. (this.beforeHeight<>tempFormHeight)
this.currWidth=tempFormWidth
this.currHeight=tempFormHeight
this.formHeightZoom=thisform.currHeight/thisform.minHeight
this.formWidthZoom=thisform.currWidth/thisform.minWidth
ENDIF
WITH this.titleLabel1
.top=24*this.formHeightZoom
.left=(this.width-.width)/2
.width=127*this.formWidthZoom
.height=29*this.formHeightZoom
.fontSize=thisform.fontReSize(.height,.width,.class,18)
ENDWITH
this.beforeWidth=this.width
this.beforeHeight=this.height
thisform.refresh
ENDPROC
PROCEDURE Activate
This.Arrange
ENDPROC
PROCEDURE Resize
This.Arrange
ENDPROC
PROCEDURE fontReSize
PARAMETERS nHeight,nWidth,nBaseClass,nBaseFontSize
thisform.addobject('testControl',nBaseClass)
WITH thisform.testControl
autoSize=.t.
LOCAL tempFontSize
FOR tempFontSize=8 TO 72
thisform.testControl.fontSize=tempFontSize
IF (thisform.testControl.height>nHeight) .or. (thisform.testControl.width>nWidth)
thisform.testControl.fontSize=tempFontSize-0.5
ENDIF
ENDFOR
ENDWITH
IF thisform.testControl.fontSize<=nBaseFontSize
RETURN nBaseFontSize
ELSE
RETURN thisform.testControl.fontSize
ENDIF
thisform.testControl.release
ENDPROC
PROCEDURE Destroy
CLEAR EVENTS
ENDPROC
ENDDEFINE
红字部分 是我想实现的方法 但是 总是有同名成员对象存在 什么情况呢?
我想这个方法实现的功能 就是把控件的宽、高、类、最低字号传进来
当窗体放大或者缩小的时候,再建一个同样的控件 进行字号对比 最后返回最适合的字号
对比完成 释放这个临时的控件
。。。 请各位老师指导一下 谢谢 迷糊了