怎样禁止一个文本框只能输入数字不能输入其他字符
vb6.0吧
全部回复
仅看楼主
level 2
sbissyguhk 楼主
文本框只能输入键盘上0~9数字输入其他键无效,求段代码。
2012年07月30日 04点07分 1
level 2
使用keypress事件
2012年08月05日 02点08分 2
level 1
用isnumber函数可以判断是不是数字
2012年08月26日 16点08分 3
level 9
If KeyAscii <= 57 And KeyAscii >= 48 Then
Else
KeyAscii = 0
End If
2012年09月04日 04点09分 5
level 4
竟然在首页!!![啊]
2013年06月30日 05点06分 8
level 2
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii > Asc("9") Or KeyAscii <Asc("0") Then
KeyAscii = 0
End If
End Sub
//////////////////////////////////////////////
Text1里面只能输入数字了
2013年07月02日 13点07分 9
level 10
用Val( )是最简单的
2013年07月16日 13点07分 10
level 1
Shutdown[滑稽]
2016年08月29日 15点08分 11
level 13
精了?
2016年10月19日 10点10分 12
1