怎么限制输入?
文本框只能输入数字和小数,怎么写,谢谢
程序代码:
Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 46 Then '输入小数点 If InStr(1, Text1.Text, ".") > 0 Then KeyAscii = 0 '只能有1个小数点 ElseIf KeyAscii < 48 Or KeyAscii > 57 Then '非数字字符 KeyAscii = 0 End If End Sub