practice5_5.frm
来自「深圳大学的vb上机与教学的课件」· FRM 代码 · 共 85 行
FRM
85 行
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 1905
ClientLeft = 60
ClientTop = 345
ClientWidth = 3480
LinkTopic = "Form1"
ScaleHeight = 1905
ScaleWidth = 3480
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "评分"
Height = 495
Left = 360
TabIndex = 2
Top = 1080
Width = 1095
End
Begin VB.TextBox Text1
Height = 495
Left = 1560
TabIndex = 1
Top = 360
Width = 1575
End
Begin VB.Label Label2
BeginProperty Font
Name = "宋体"
Size = 15
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1680
TabIndex = 3
Top = 1200
Width = 975
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请输入成绩:"
Height = 180
Left = 360
TabIndex = 0
Top = 480
Width = 990
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()
x = Val(Text1.Text)
Select Case x
Case Is < 0, Is > 100
Label2.Caption = ""
MsgBox "输入的数据超出范围,请重新输入"
Case Is >= 90
Label2.ForeColor = vbBlue
Label2.Caption = "优"
Case Is >= 80
Label2.ForeColor = vbBlue
Label2.Caption = "良"
Case Is >= 70
Label2.ForeColor = vbBlue
Label2.Caption = "中"
Case Is >= 60
Label2.ForeColor = vbBlue
Label2.Caption = "及格"
Case Else
Label2.ForeColor = vbRed
Label2.Caption = "不及格"
End Select
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?