vb程序case语句

来源:百度知道 编辑:UC知道 时间:2024/06/06 15:57:10
vb编程,分数转化为等第,小于60不及格,60-70及格,70-80中,80-90良,90-100优秀,输入其余跳出“输入错误窗口”,用CASE怎么编啊?
在text里打入分数,在label里显示等第

Private Sub Text1_Change()
Select Case Val(Text1.Text)
Case 0 To 60
Label1.Caption = "不及格"
Case 60 To 70
Label1.Caption = "及格"
Case 70 To 80
Label1.Caption = "中"
Case 80 To 90
Label1.Caption = "良"
Case 90 To 100
Label1.Caption = "优秀"
Case Else
Label1.Caption = "输入错误"
End Select

End Sub

select case fenshu
case <60
"不及格"
case>60 and <70
"及格"
case>60 and <80
"中"
end select