private sub button1_clik(byval sender as system.object,byval e as system.eventargs)handles button1.click dim x x=inputbox("请输入") if not IsNumeric(x) then msgbox("不是数字") else msgbox("是数字") end if end sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged If IsNumeric(Me.TextBox1.Text) Then Label1.Text = "数字" Else Label1.Text = "字符" End If End Sub