我有一个邮政编码的文本框,其中我做了一个验证,即用户输入的数字少于或多于6,但即使用户输入了3个数字,它仍在工作。我想要显示错误消息,如果用户进入不对劲如何验证TextBox?
Private Shared Function ValidateZip(ByVal pintZip As String, ByRef pobjErrMsg As Common.ErrorMessage) As Boolean
If pintZip.Length <> 6 Then
ElseIf IsNumeric(pintZip) Then
End If
Return True
End Function
所以你写的'如果pintZip.Lenght <> 6 Then'然后呢? – Hoh
我上面提到过,如果用户输入错误的邮政编码,我想显示一条错误消息 – anuj