非常简单的问题,如何将 and or 运算符组合到同一个语句中。
c.GetType 是 getType(TextBox) AND foo 或 bar 或 baz
这是行不通的
For Each c As Control In Me.Controls
If (c.GetType Is GetType(TextBox)) And ((c.Name <> "txtID") Or (c.Name <> "txtAltEmail")) Then
'do something
End If
Next
这有效:
For Each c As Control In Me.Controls
If (c.GetType Is GetType(TextBox)) And (c.Name <> "txtID") Then
'do something
End If
Next
谢谢,我是.net 新手!