How can i limit a txt value between 1->25 and return an error msg if the value was...
The only problem now is when i enter a negative number the program fails.
Edit:Under these circumstances, if the user entered the number -27,
the control wouldn't accept it because the beginning dash isn't
a number
VB.NET:
Dim PresureA As Integer
If (pa.Text > 25) Then
pa.Text = 25
PresureA = MsgBox("Pressure angle cannot exceed 25!", vbExclamation, "Error!")
End If
If (pa.Text < 0) Then
pa.Text = 0
PresureA = MsgBox("Pressure angle cannot be less than zero!", vbExclamation, "Error!")
End If
The only problem now is when i enter a negative number the program fails.
Edit:Under these circumstances, if the user entered the number -27,
the control wouldn't accept it because the beginning dash isn't
a number
Last edited: