Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar Like "[0-9]" Then
Else
MsgBox("不是数字!")
e.Handled = True
End If
End Sub
Dim istg_check_char as string
istg_check_char=Text1.Text.Trim(Me.istg_char)
If istg_check_char="" then
Messagebox.show("為數字型")
else
Messagebox.show("為字符串")
End If