form1.frm
来自「上传的包含两个文件」· FRM 代码 · 共 260 行
FRM
260 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 4095
ClientLeft = 60
ClientTop = 450
ClientWidth = 8625
LinkTopic = "Form1"
ScaleHeight = 4095
ScaleWidth = 8625
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "平均分"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 5640
TabIndex = 12
Top = 1200
Width = 975
End
Begin VB.CommandButton Command3
Caption = "清空"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3000
TabIndex = 11
Top = 2760
Width = 1095
End
Begin VB.TextBox Text6
Height = 495
Left = 6960
TabIndex = 6
Text = "Text6"
Top = 1920
Width = 975
End
Begin VB.TextBox Text5
Height = 495
Left = 5640
TabIndex = 5
Text = "Text5"
Top = 1920
Width = 975
End
Begin VB.CommandButton Command2
Caption = "总分"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 615
Left = 6960
TabIndex = 4
Top = 1200
Width = 855
End
Begin VB.TextBox Text4
Height = 495
Left = 4320
TabIndex = 3
Text = "Text4"
Top = 1920
Width = 975
End
Begin VB.TextBox Text3
Height = 495
Left = 3120
TabIndex = 2
Text = "Text3"
Top = 1920
Width = 975
End
Begin VB.TextBox Text2
Height = 495
Left = 1800
TabIndex = 1
Text = "Text2"
Top = 1920
Width = 975
End
Begin VB.TextBox Text1
Height = 495
Left = 480
TabIndex = 0
Text = "Text1"
Top = 1920
Width = 975
End
Begin VB.Label Label6
Caption = "总分"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 14
Top = 600
Width = 735
End
Begin VB.Label Label5
Caption = "平均分"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 120
TabIndex = 13
Top = 120
Width = 735
End
Begin VB.Label Label4
Caption = "vb程序"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 4440
TabIndex = 10
Top = 1320
Width = 975
End
Begin VB.Label Label3
Caption = "英语"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 3240
TabIndex = 9
Top = 1320
Width = 975
End
Begin VB.Label Label2
Caption = "数学"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1920
TabIndex = 8
Top = 1320
Width = 975
End
Begin VB.Label Label1
Caption = "学号"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 600
TabIndex = 7
Top = 1320
Width = 975
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer, s As Integer, a(1 To 6) As Integer
Private Sub Command1_Click()
Call program
a(5) = s / 3
Text5.Text = a(5)
Print
Print Space(10); a(5);
End Sub
Private Sub command2_click()
Call program
a(6) = s
Text6.Text = a(6)
Print
Print
Print Space(10); a(6);
End Sub
Sub program()
a(1) = Text1.Text
a(2) = Text2.Text
a(3) = Text3.Text
a(4) = Text4.Text
s = 0
ss = 0
For i = 2 To 4
s = s + a(i)
Next i
End Sub
Private Sub Command3_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?