合金装备幻痛静静不走:VB中怎样让textbox中支持输入“,”?

来源:百度文库 编辑:高考问答 时间:2024/04/20 10:50:38
以下是代码:
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

请问怎样修改就可以输入 ,号

把case 8,48 to 57改成:

case 8,44,48 to 57

以上。
查码表的老狼