使用VB编写设计计算语文、数学、英语这三门课程平均成绩的程序,利用文本框作数据的输入和输出

来源:百度知道 编辑:UC知道 时间:2024/09/24 19:23:30

楼上太长了...

四个文本框,前三个输入,最后一个输出
一个按钮,按钮的单击响应代码如下:
Private Sub Command1_Click()
Dim pingjun As Double
pingjun = (Val(Text1.Text) + Val(Text2.Text) + Val(Text3.Text)) / 3
Text4.Text = pingjun
End Sub

VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3120
ClientLeft = 60
ClientTop = 420
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3120
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command3
Caption = "退出"
Height = 465
Left = 3810
TabIndex = 10
Top = 2580
Width = 765
End
Begin VB.CommandButton Command2
Caption = "重填"
Height