VB中怎样让textbox中支持输入“,”?
以下是代码:PrivateSubText1_KeyPress(KeyAsciiAsInteger)SelectCaseKeyAscii'判断负号Case45IfText1...
以下是代码:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
'判断负号
Case 45
If Text1.SelStart <> 0 Then KeyAscii = 0
'判断入小数点
Case 46
If InStr(1, Text1.Text, ".") > 0 Then KeyAscii = 0
Case 8, 48 To 57
Case Else
KeyAscii = 0
End Select
End Sub
请问怎样修改就可以输入 ,号 展开
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
'判断负号
Case 45
If Text1.SelStart <> 0 Then KeyAscii = 0
'判断入小数点
Case 46
If InStr(1, Text1.Text, ".") > 0 Then KeyAscii = 0
Case 8, 48 To 57
Case Else
KeyAscii = 0
End Select
End Sub
请问怎样修改就可以输入 ,号 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询