private sub text1_keypress(keyascii as integer)
if keyascii<48 or keyascii>57 then
keyascii=0
text1.setfocus
end if
if keyascii<48 or keyascii>57 then
keyascii=0
text1.setfocus
end if
调试欢乐多
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> 8 And KeyAscii <> 13 And KeyAscii <> Asc(".") Then
KeyAscii = 0
End If
If Not (KeyAscii > 47 And KeyAscii < 58 Or KeyAscii = 13 Or KeyAscii = 8 Or KeyAscii = 46) Then KeyAscii = 0
End Sub以上只能输入数字和小数点
必须是数字可以用函数ISNUMRIC(text1.text)返回值是否为true
================================================================
靠,各位兄弟这么有才华,我...我..............5555555555555555