visual fox pro 的一个表单的题目 谁能告诉我怎么做啊~ 10
1、在d:\data文件夹下有zgda.dbf和zggz.dbf表,请编写并运行符合下列要求的表单,并将该表单保存在d:\data文件夹下:设计一个名为form_stu的...
1、在d:\data文件夹下有zgda.dbf和zggz.dbf表,请编写并运行符合下列要求的表单,并将该表单保存在d:\data文件夹下:
设计一个名为form_stu的表单,表单中有两个命令按钮、一个文本框,两个命令按钮的标题分别为"统计"和"关闭"。
程序运行时,单击"统计"按钮完成下列操作:
根据zggz.dbf表计算所有职工的平均基本工资,并将结果显示在文本框中;
单击"关闭"按钮,程序终止运行 展开
设计一个名为form_stu的表单,表单中有两个命令按钮、一个文本框,两个命令按钮的标题分别为"统计"和"关闭"。
程序运行时,单击"统计"按钮完成下列操作:
根据zggz.dbf表计算所有职工的平均基本工资,并将结果显示在文本框中;
单击"关闭"按钮,程序终止运行 展开
2个回答
展开全部
ols=createobject("form1")
ols.show
DEFINE CLASS form1 AS form
Top = 11
Left = 115
Height = 200
Width = 300
Desktop = .T.
DoCreate = .T.
Caption = "表单实例"
Name = "form_stu"
ADD OBJECT cmdok AS commandbutton WITH ;
Top = 150, ;
Left = 90, ;
Height = 25, ;
Width = 60, ;
Caption = "统计", ;
Name = "cmdOk", ;
TabIndex = 2
ADD OBJECT cmdyl AS commandbutton WITH ;
Top = 150, ;
Left = 150, ;
Height = 25, ;
Width = 60, ;
Caption = "关闭", ;
Name = "cmdyl", ;
TabIndex = 1, ;
Default = .T.
ADD OBJECT pjjbgzs AS textbox WITH ;
Alignment = 3, ;
Value = 0, ;
Height = 20, ;
Left = 120, ;
SelectOnEntry = .T., ;
Top = 75, ;
Width = 49, ;
Name = "pjjbgzs", ;
TabIndex = 3
PROCEDURE Init
With thisform
.MinButton = .T.
.MaxButton = .T.
.Borderstyle= 2
.WindowType = 1
.AutoCenter = .T.
Endwith
public pjjbgz
pjjbgz=0
ENDPROC
PROCEDURE cmdok.Click
set talk off
use d:\data\zggz.dbf.dbf excl
aver 基本工资 to pjjbgz &&你的“基本工资”字段名
thisform.pjjbgzs.value=pjjbgz
use
thisform.refresh
set talk on
ENDPROC
PROCEDURE cmdyl.Click
thisform.release
ENDPROC
ENDDEFINE
ols.show
DEFINE CLASS form1 AS form
Top = 11
Left = 115
Height = 200
Width = 300
Desktop = .T.
DoCreate = .T.
Caption = "表单实例"
Name = "form_stu"
ADD OBJECT cmdok AS commandbutton WITH ;
Top = 150, ;
Left = 90, ;
Height = 25, ;
Width = 60, ;
Caption = "统计", ;
Name = "cmdOk", ;
TabIndex = 2
ADD OBJECT cmdyl AS commandbutton WITH ;
Top = 150, ;
Left = 150, ;
Height = 25, ;
Width = 60, ;
Caption = "关闭", ;
Name = "cmdyl", ;
TabIndex = 1, ;
Default = .T.
ADD OBJECT pjjbgzs AS textbox WITH ;
Alignment = 3, ;
Value = 0, ;
Height = 20, ;
Left = 120, ;
SelectOnEntry = .T., ;
Top = 75, ;
Width = 49, ;
Name = "pjjbgzs", ;
TabIndex = 3
PROCEDURE Init
With thisform
.MinButton = .T.
.MaxButton = .T.
.Borderstyle= 2
.WindowType = 1
.AutoCenter = .T.
Endwith
public pjjbgz
pjjbgz=0
ENDPROC
PROCEDURE cmdok.Click
set talk off
use d:\data\zggz.dbf.dbf excl
aver 基本工资 to pjjbgz &&你的“基本工资”字段名
thisform.pjjbgzs.value=pjjbgz
use
thisform.refresh
set talk on
ENDPROC
PROCEDURE cmdyl.Click
thisform.release
ENDPROC
ENDDEFINE
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询