老师,如题,登录窗口输密码那里电脑的小键盘不能用,有2台都不能用小键盘输入6为数字?
validating :
Dim pattern As String = "^[0-9]{6}$"
Dim txt As String = e.Sender.Text
If txt > "" Then
Dim rgx = new System.Text.RegularExpressions.Regex(pattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase)
If rgx.isMatch(txt) = False Then
e.Sender.Error = "密码是6位数字!"
e.cancel = True
Else
e.Sender.Error = ""
End If
Else
e.Sender.Error = ""
End If
keydown:
If e.KeyCode >= Asc("0") AndAlso e.keycode <= Asc("9") Then
If e.sender.text.length > 5 Then
e.cancel = True
End If
ElseIf e.KeyCode <> Keys.back Then
e.cancel = True
End If
老师,这是我关于密码那个控件的代码?