vb设置了一个检验是否为数字的keypress但是输入数字也是0
PrivateSubTextBox1_KeyPress(ByValKeyAsciiAsMSForms.ReturnInteger)If(KeyAscii<48OrKeyA...
Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then
KeyAscii = 0
End If
End Sub
但是我我输入数字也显示的是0 展开
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then
KeyAscii = 0
End If
End Sub
但是我我输入数字也显示的是0 展开
展开全部
Private Sub Text1_KeyPress(KeyAscii As Integer)
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then
KeyAscii = 0
End If
Print KeyAscii
End Sub
If (KeyAscii < 48 Or KeyAscii > 57) And KeyAscii <> 46 Then
KeyAscii = 0
End If
Print KeyAscii
End Sub
追问
恕我愚笨,没看出那行Print KeyAscii有什么用
还有我那行
(ByVal KeyAscii As MSForms.ReturnInteger)
是选择keypress自动补出来的,改掉不要紧吗?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询