Private Sub TextBox_ComputerID_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox_ComputerID.KeyPress
If e.KeyChar = Microsoft.VisualBasic.ChrW(13) Then
Me.Button_Search.Focus()
End If
Dim strlimit As String
strlimit = "0123456789"
Dim keychar As Char = e.KeyChar
If InStr(strlimit, keychar) <> 0 Or e.KeyChar = Microsoft.VisualBasic.ChrW(8) Then
e.Handled = False
Else
e.Handled = True
End If
End Sub
vb.net 文本框只能输入数字和退格键
最新推荐文章于 2017-07-28 13:27:18 发布