如何在visualfoxpro6.0的表单中自定义表单属性和方法?

2025-02-25 01:25:01
推荐回答(1个)
回答1:

打开表单时,在主菜单点击表单菜单,点击新建表单属性与方法

如图

例子:新建属性 times 在属性面板设置times=0

在登陆表里用到如果登陆错误次数超过3次退出

if thisform.times>3

thisform.release

endif

新建表单方法:getgrid   (用此设置表格的大小宽度)

双击表单打开表单方法getgrid写如下代码:

thisform.grid1.column1.width=thisform.grid1.width/4

thisform.grid1.column2.width=thisform.grid1.width/5  &&设置列宽

thisform.grid1.recordsource="表1"

然后在其它代码中调用

thisform.getgrid

thisform.refresh