非常简单的问题,如何结合和或运营商到相同的陈述。vb.net结合和或或运营商
c.GetType是的getType(文本框)和Foo或酒吧或巴兹
这是行不通的
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
感谢,我是。网新手!
你得到什么错误?第一个陈述对我来说很好 – Luis 2012-07-11 22:03:32
@ LuisSchechez:第一个语句等同于'If(c.GetType是GetType(TextBox))和True Then'。 – Heinzi 2012-07-11 22:14:23
@Heinzi事实上,我在那里看到和'='而不是'<>' – Luis 2012-07-11 22:23:37