谢谢 待我研究下
以下是引用wzxc在2012-2-18 16:32:10的发言:
关于楼主的问题,我写了两个简单的表单文件,你可以下载来运行看看。注意他们的文件名,name属性,caption属性的运用。
我下载测试,关闭提示出错。是VFP8.0的。
关于楼主的问题,我写了两个简单的表单文件,你可以下载来运行看看。注意他们的文件名,name属性,caption属性的运用。
程序代码:
fm1 =createobject("form1")
fm1.show(1)
define class form1 as form
width =500
height = 480
autocenter =.t.
add object lb1 as label with top =200,height=50,width=500,alignment=2,fontsize=36,caption="表单1"
add object cmd1 as commandButton with top =20,height=35,left=330,width=150,caption="打开表单2"
add object cmd2 as commandButton with top =56,height=35,left=330,width=150,caption="关闭表单1(包括表单2)"
proc destroy
if type("fm2")="O"
release fm2
endif
proc cmd1.click
打开表单2()
proc cmd2.click
if type("fm2")="O"
release fm2
endif
thisform.release
enddefine
*
proc 打开表单2
fm2 =createobject("form2")
fm2.show
read events
define class form2 as form
width =300
height = 240
add object lb1 as label with top =100,height=50,width=300,alignment=2,fontsize=36,caption="表单2"
proc destroy
clea events
enddefine