vb代码怎么控制一个文本框只能输入数字和字母?
展开全部
Private Sub TextBox7_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox7.KeyPress
Dim c As Char
c = e.KeyChar
If Not Char.IsLetterOrDigit(c) Then
e.Handled = True
Beep()
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询