请问各位大虾ElseIf……Then语句 有什么功能
请问各位大虾ElseIf……Then语句 有什么功能

学习VB中~~~~~~~~~~~~~

Private Sub Command1_Click()
If Text1 = "slore" Then
MsgBox "slore"
ElseIf Text1 = "lee" Then
MsgBox "lee"
ElseIf Text1 = "slorelee" Then
MsgBox "slorelee"
Else
MsgBox "wrong"
End If
End Sub
差不多相当于:
Private Sub Command1_Click()
If Text1 = "slore" Then
MsgBox "slore"
End If
If Text1 = "lee" Then
MsgBox "lee"
End If
If Text1 = "slorelee" Then
MsgBox "slorelee"
End If
End Sub
不过else就……