In my program the text-box should accept only integers and it should prompt a message if a character is entered in the text box. But it is taking the backspace button that the user may use to clear the entered data as a character and prompting warning message
How can i make the backspace not be considered a character or make the program accept integers and backspace?
this is the try catch statement I'm using to handle the character entering error:
THANK YOU!
How can i make the backspace not be considered a character or make the program accept integers and backspace?
this is the try catch statement I'm using to handle the character entering error:
Code:
Dim z As Integer
Try
z = CInt(TxtQP.Text)
Catch ex As Exception
MessageBox.Show("Characters are not allowed, Please Enter a Number")
TxtQP.Text = 1
TxtQP.Focus()
Exit Sub
End Try
Comment