By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,956 Members | 1,722 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,956 IT Pros & Developers. It's quick & easy.

how to signal WinForm control input out of range?

P: 93
Is there a way (perhaps via EventArgs) to signal the app when a user tries to enter out-of-range input into a WinForm control? (Specifically, a number in a NumericUpDown control numericUpDown1 that is larger than numericUpDown1.Maximum?) Yes, I know the control won't allow the input, but I want to display an error message if this happens.
Mar 5 '09 #1
Share this Question
Share on Google+
2 Replies


tlhintoq
Expert 2.5K+
P: 3,525
There are none built in that I am aware of. What you could do is allow a greater range, do the validation yourself, raise a custom event, then set the value to the max you will allow.
Mar 6 '09 #2

Plater
Expert 5K+
P: 7,872
If you make your own control derived from the numericupdown, there are some private functions that look promising.
There's a "onTextChanged" and "onTextboxTextChanged" and "ValidateEditText" that might be helpful.
Mar 6 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.