![]() |
#2
apull2021-05-08 08:43
|
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 Then Exit Sub
If KeyAscii = 13 Then Exit Sub
If KeyAscii = 88 Then Exit Sub
If KeyAscii = 120 Then Exit Sub
If KeyAscii > 57 Or KeyAscii < 48 Then KeyAscii = 0
End Sub
或者
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 8 or KeyAscii = 13 or KeyAscii = 88 or KeyAscii = 120 Then Exit Sub
If KeyAscii > 57 Or KeyAscii < 48 Then KeyAscii = 0
End Sub
身份证输入框的事件,用keyUp好还是keyPress好?