【发布时间】:2017-01-02 14:41:21
【问题描述】:
我想测试文本框是否为空以进行验证,而不是使用 if x = ""。相反,我想知道是否有更好的方法来做到这一点。目前我有:
If txtDob Is Nothing Or txtFirst Is Nothing Or txtGender Is Nothing Or txtLast Is Nothing Or txtPostcode Is Nothing Or txtStreetName Is Nothing Or txtStreetNo.Text Is Nothing Then
MessageBox.Show("One or more fields have not been completed")
Return
End If
但是,这似乎不起作用,有人可以告诉我正确的方法或其他方法吗?
【问题讨论】:
-
抱歉,我没有注意到那个帖子。下次我会注意的。
标签: vb.net