VB编程的问题,Private Sub Command1_Click()
PrivateSubCommand1_Click()DimpmAsSingle,sAsStringpm=Val(Text1.Text)Ifpm<=50Thens="优"E...
Private Sub Command1_Click()
Dim pm As Single, s As String
pm = Val(Text1.Text)
If pm <= 50 Then
s = "优"
ElseIf pm <= 100 Then
s = "良"
ElseIf pm <= 150 Then
s = "轻度污染"
ElseIf pm <= 200 Then
s = "中度污染"
ElseIf pm <= 300 Then
s = "重度污染"
Else '①
s = "严重污染"
End If
Label2.Caption = Str(s) '②
End Sub
上述编程标着'②的地方错了,求大神改一下 展开
Dim pm As Single, s As String
pm = Val(Text1.Text)
If pm <= 50 Then
s = "优"
ElseIf pm <= 100 Then
s = "良"
ElseIf pm <= 150 Then
s = "轻度污染"
ElseIf pm <= 200 Then
s = "中度污染"
ElseIf pm <= 300 Then
s = "重度污染"
Else '①
s = "严重污染"
End If
Label2.Caption = Str(s) '②
End Sub
上述编程标着'②的地方错了,求大神改一下 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询