This seems so simple but all google comes up with is 'numbers only for textbox'
Basically 1 textbox. On key press i want to check the user has not entered a number greater then 2500
but for some reason txtWidth is always 1 number less then my textbox
example,
1 = txtWidth 0
then i enter a 2 into the textbox
txtWidth = 1
then i enter a 3 into the textbox
txtwidth = 12
and so on. make sense?
Basically 1 textbox. On key press i want to check the user has not entered a number greater then 2500
VB.NET:
Dim txtWidth = Val(txtWidth.Text)
If txtWidth > 2500 Then
'handle what ever code here
txtWidth.Text = ""
Exit Sub
End If
but for some reason txtWidth is always 1 number less then my textbox
example,
1 = txtWidth 0
then i enter a 2 into the textbox
txtWidth = 1
then i enter a 3 into the textbox
txtwidth = 12
and so on. make sense?