Student working on ASP.NET project for VB that is trying to restrict users from entering anything accept numbers into the text boxes using a CASE statement, but I keep getting System.EventArgs errors.
My Code:
Protected Sub ValueBox1_TextChanged(sender As Object, e As EventArgs) Handles ValueBox1.TextChanged
Select Case e.KeyChar
Case "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", vbBack
e.Handled = False
Case Else
e.Handled = True
End Select
End Sub
Errors = 'KeyChar' and 'Handled' are not members of 'System.EventArgs'
I have tried changing it to a KeyPress event
(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)Handles TextBox1.KeyPress
but then the message changes to "KeyPress" cannot be found.I know I'm close but have tried so many other changes and suggestions it feels like I'm going in circles.