Click here to Skip to main content
15,886,799 members
Articles / Desktop Programming / Windows Forms

WinForms TextBox to accept numbers in a range

Rate me:
Please Sign up or sign in to vote.
4.20/5 (2 votes)
2 Jan 2012CPOL 11.7K  
A few notes on this code: Wouldn't you get an exception if the user happens to put in a number bigger than can be stored in an int32? Wouldn't int32.TryParse be better because of this?The control can be initialized with a negative number as a constraint, but it doesn't permit the '-'...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Product Manager
United States United States
I've been programming in C, C++, Visual Basic and C# for over 35 years. I've worked at Sierra Systems, ViewStar, Mosaix, Lucent, Avaya, Avinon, Apptero, Serena and now Guidewire Software in various roles over my career.

Comments and Discussions