态生成,那么表单上的表格对象的数据源不就完全重新加载了吗?也用不着刷新什么的了!而且,用这个方法也用不着先建立一个tempview视图,完全在程序中动态生成就可以了主意一定,马上下床动手。将原来包含表格的表单form1删除,在上述的代码中最后一句
thisformset.form1.show前插入以下代码:
*************************************************************
thisformset.addobject("form1","form")
with thisformset.form1
.caption="查询结果"
.width=600
.height=400
.Autocenter=.t.
.controlbox=.f.
endwith
thisformset.form1.addobject("cmdReturn1","cmdReturn")
with thisformset.form1.cmdReturn1
.top=360
.left=270
endwith
thisformset.form1.addobject("grid1","gird")
with thisformset.form1.grid1
.Recordsourcetype=1
.Recordsource="tempview"
.top=10
.left=20
.height=300
.width=560
endwith
**************************************************************
在程序的最后加入:
*********************************************
Define class cmdReturn as commandbutton
caption="返回"
procdure click
thisform.release
endproc
enddefine
*********************************************
这下总可以了吧?运行程序,结果出现对话框"在事件或方法中不能嵌套类定义!"。我@#$%&*....什么嘛!教科书、帮助文件中的示例prg都是这么写的啊!
不过好在还有办法,我手工建立一个类总行了吧!在类库my
thisformset.form1.show前插入以下代码:
*************************************************************
thisformset.addobject("form1","form")
with thisformset.form1
.caption="查询结果"
.width=600
.height=400
.Autocenter=.t.
.controlbox=.f.
endwith
thisformset.form1.addobject("cmdReturn1","cmdReturn")
with thisformset.form1.cmdReturn1
.top=360
.left=270
endwith
thisformset.form1.addobject("grid1","gird")
with thisformset.form1.grid1
.Recordsourcetype=1
.Recordsource="tempview"
.top=10
.left=20
.height=300
.width=560
endwith
**************************************************************
在程序的最后加入:
*********************************************
Define class cmdReturn as commandbutton
caption="返回"
procdure click
thisform.release
endproc
enddefine
*********************************************
这下总可以了吧?运行程序,结果出现对话框"在事件或方法中不能嵌套类定义!"。我@#$%&*....什么嘛!教科书、帮助文件中的示例prg都是这么写的啊!
不过好在还有办法,我手工建立一个类总行了吧!在类库my
没有相关信息学院
| 对此文章发表了评论 |
