Public Function OnlyNumberAndDot(inKeyAscii As Integer) As Integer
'函数说明:文本框只支持数字、小数点、退格符、负号、Del键
'入口说明:
' inKeyAscii 'Text 控件的 KeyPress 事件的 KeyAscii 参数
'出口说明:
'返回值:inKeyAscii
If inKeyAscii < 48 Or inKeyAscii > 57 Then '选取范围之内的
If (inKeyAscii <> 46) And (inKeyAscii <> 8) And (inKeyAscii <> 45) And (inKeyAscii <> 127) Then
inKeyAscii = 0
End If
End If
OnlyNumberAndDot = inKeyAscii
End Function