This is part of a homework assignment for class and its driving me up a wall.
Using VB.NET I need to take an input textbox and using keypress I need to restrict the keys that the user can type to letters only -no special characters and no numbers.
If you have any ideas about this code, please let me know. I've been working on this for three hours now and i know I'm making it more difficult than it is.
Also, I'm kinda new to the whole programming thing.. so before you write an explanation completely in jargon.. try to dumb it down a little for me if you can please.
"Private Sub StateTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles StateTextBox.KeyPress
If e.KeyChar (something to restrict to letter chars only) Then
e.Handled = True
End If
End Sub"
thanks for any help you can give!
christopher
Using VB.NET I need to take an input textbox and using keypress I need to restrict the keys that the user can type to letters only -no special characters and no numbers.
If you have any ideas about this code, please let me know. I've been working on this for three hours now and i know I'm making it more difficult than it is.
Also, I'm kinda new to the whole programming thing.. so before you write an explanation completely in jargon.. try to dumb it down a little for me if you can please.
"Private Sub StateTextBox_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles StateTextBox.KeyPress
If e.KeyChar (something to restrict to letter chars only) Then
e.Handled = True
End If
End Sub"
thanks for any help you can give!
christopher