vb中的IsNumeric函数怎么使用啊

来源:百度知道 编辑:UC知道 时间:2024/05/20 03:26:01
谢喽

If IsNumeric(textbox1.text) Then
'结果是textbox1.text的值都是数值型,
else
textbox1.text的值为字符串型
endif

判断是否是数字
If IsNumeric(Text2.Text) Then
Me.Text2.Text = "Is a Number"
Else
Me.Text2.Text = "Not a Number"
End If

判断是否是数值
例如:
a=123
if isnumeric(a) then
msgbox "a是数值"
end if

比较喜欢用ASCILL来限制数字的输入