pexam4_2.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 255 行
FRM
255 行
VERSION 5.00
Begin VB.Form Form1
Caption = "计算平均成绩"
ClientHeight = 2955
ClientLeft = 60
ClientTop = 345
ClientWidth = 3975
LinkTopic = "Form1"
ScaleHeight = 2955
ScaleWidth = 3975
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text4
Alignment = 1 'Right Justify
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1320
Locked = -1 'True
TabIndex = 10
Top = 1560
Width = 1935
End
Begin VB.CommandButton Command3
Caption = "退出"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 2760
TabIndex = 8
Top = 2160
Width = 1095
End
Begin VB.CommandButton Command2
Caption = "清除"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 1500
TabIndex = 7
Top = 2160
Width = 1095
End
Begin VB.CommandButton Command1
Caption = "计算"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 240
TabIndex = 6
Top = 2160
Width = 1095
End
Begin VB.TextBox Text3
Alignment = 1 'Right Justify
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1320
TabIndex = 5
Top = 1070
Width = 1935
End
Begin VB.TextBox Text2
Alignment = 1 'Right Justify
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 405
Left = 1320
TabIndex = 4
Top = 580
Width = 1935
End
Begin VB.TextBox Text1
Alignment = 1 'Right Justify
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1320
TabIndex = 3
Top = 120
Width = 1935
End
Begin VB.Label Label4
AutoSize = -1 'True
Caption = "平均:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 480
TabIndex = 9
Top = 1680
Width = 900
End
Begin VB.Label Label3
AutoSize = -1 'True
Caption = "物理:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 480
TabIndex = 2
Top = 1200
Width = 900
End
Begin VB.Label Label2
AutoSize = -1 'True
Caption = "外语:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 480
TabIndex = 1
Top = 720
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "数学:"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 285
Left = 480
TabIndex = 0
Top = 240
Width = 900
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
A = Val(Text1.Text)
B = Val(Text2.Text)
C = Val(Text3.Text)
Text4.Text = (A + B + C) / 3
End Sub
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text1.SetFocus
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Text1_Change()
Text4.Text = ""
End Sub
Private Sub Text1_GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text2_Change()
Text4.Text = ""
End Sub
Private Sub Text2_GotFocus()
Text2.SelStart = 0
Text2.SelLength = Len(Text1.Text)
End Sub
Private Sub Text3_Change()
Text4.Text = ""
End Sub
Private Sub Text3_GotFocus()
Text3.SelStart = 0
Text3.SelLength = Len(Text1.Text)
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?