在VB里面的文本框输入数据,怎么能够证实输入TextBox.Text为integer类型的
来源:百度知道 编辑:UC知道 时间:2024/05/22 13:55:05
如题
在通用部分定义一个变量 Public bIsNum As Boolean
Private Sub Command1_Click()
Dim i As Integer
For i = 1 To Len(Text1.Text)
If IsNumeric(Mid(Text1.Text, i, 1)) Then
bIsNum = True
Else
bIsNum = False
End If
Next i
If bIsNum = True Then
MsgBox "是数字"
Else
MsgBox "不是数字"
End If
End Sub
isnumeric(textbox.text)
在代码上面定义为integer型!
Dim **** AS Integer