I have a numericupdown with a minimum set at 0 and a maximum at 100. However, at run-time a user may input an infinite number by skipping the arrows and inputting numbers with keys. I have tried to solve this myself but my error message won't popup until the user presses the enter key.
What I would really like to do to by-pass this issue is to limit the number (cannot enter a value greater than '100') or to disallow a cursor to be placed in the NumericUpDown (user would only be allowed to use the arrows to select a number).Code:Private Sub spnMiscQty_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles spnMiscQty.ValueChanged If spnMiscQty.Value = 100 Then MessageBox.Show("Pick a Quantity between 1 and 100") Else End If End Sub
Thanks in advance for any help you may provide.




Reply With Quote