威尔士健身卡转让滨江:在VB里面的文本框输入数据,怎么能够证实输入TextBox.Text为integer类型的
来源:百度文库 编辑:神马品牌网 时间:2024/05/05 17:42:17
如题
在通用部分定义一个变量 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