我将“ if”设置为“或”条件并给出错误
If textbox1.Text = "abc def" Or "def" Then
我知道我写的不对吗? 我怎么了?
答案 0 :(得分:3)
如果您有很多条件,请使用“选择大小写”:
Select Case textbox1.Text
Case “abc def”, “def”, “xyz”
MsgBox “Note that multiple values may be captured here, separated by commas”
Case “abc”
MsgBox “Just abc”
Case Else
MsgBox “Everything else”
End Select
答案 1 :(得分:2)
您需要重新声明测试对象
If textbox1.Text = "abc def" Or textbox1.Text = "def" Then