Setting minimum and maximum values of text box in VB .net 2010
I want to set minValue and maxValue of text boxes to开发者_高级运维 define a range of acceptable values for validation purposes.
In VB 6 this is straight forward and can be done under text box properties, however in visual studio vb .net 2010 this is not the case or it may be the case that i am missing something.
Thanks, Ayub
In WinForms, there is a NumericUpDown control that you can use, and it has properties for Minimum and Maximum.
What you need is a numeric text box control with according properties. AFAIK MS does not provide one, but there are free solutions available like this one:
http://www.codeproject.com/KB/edit/HDNumericTextBox.aspx
make a customized textbox - thats checks the ascii of the entered value and - restrict the value to numeric., like - try with KeyDown or keypress events of text box and catch the keycode or event sender..
Try using the RangeValidator.
精彩评论