Foxtable(狐表)用户栏目专家坐堂 → 登录窗口输密码那里电脑的小键盘不能用


  共有1863人关注过本帖树形打印复制链接

主题:登录窗口输密码那里电脑的小键盘不能用

美女呀,离线,留言给我吧!
susu312
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:997 积分:6752 威望:0 精华:0 注册:2018/6/8 16:17:00
登录窗口输密码那里电脑的小键盘不能用  发帖心情 Post By:2018/9/3 13:40:00 [只看该作者]

老师,如题,登录窗口输密码那里电脑的小键盘不能用,有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

 

老师,这是我关于密码那个控件的代码?


 回到顶部
帅哥哟,离线,有人找我吗?
有点甜
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2018/9/3 14:21:00 [只看该作者]

'msgbox(e.keycode)
If e.KeyCode >= Asc("0") AndAlso e.keycode <= Asc("9") OrElse e.keycode >= 96 AndAlso e.keycode <= 106 Then
    If e.sender.text.length > 5 Then
        e.cancel = True
    End If
ElseIf e.KeyCode <> Keys.back Then
    e.cancel = True
End If

 回到顶部