[求助]如何控制text里的汉字,数字输入?
比如说,姓名只能输入汉字,电话只能输入数字,且数字是多少位怎么控制,高手请指点一下,小弟刚学,头都快大了,谢谢了
Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii > 47 And KeyAscii < 58 Then Exit Sub '允许输入0-9
If KeyAscii = 8 Then Exit Sub '允许退格
If KeyAscii = 46 Then Exit Sub '允许tab
'同理可添加允许的其它键值
'其它键值都不允许
KeyAscii = 0
End Sub