Hi all,
anybody can please tell me how to set textBox control to take decimal values.
decimal point should already be there in text box control .
thanks
regards
Printable View
Hi all,
anybody can please tell me how to set textBox control to take decimal values.
decimal point should already be there in text box control .
thanks
regards
That would require a MaskedTextbox control instead.
MaskedTextbox is in .NET 2.0 :D
For now, we have this:
http://msdn.microsoft.com/library/de...bjMaskEdit.asp
The only problem with a mask is that you will generally have to set the number of characters before and after the decimal point. What you may like to do is use a derived TextBox that only accepts numerical values. You can then add a ".0" in the Validating event if the user hasn't entered one. If you follow the "Windows Forms Components" link in my signature you can download a library that includes a NumberBox.
Thanks to all of you,
actually i have downloaded "valitText .dll" but the problem is that user cant reach to the decimal point by pressing "." and while data-entry user cant use arrow keys or any other keys except numeric keys . so it is useless in dataentry type application. and if i have to do some excercise in text changed event, then what is the use of "validText.dll" . i m still using .net 2002, . is there ready to use control which will facilitate all this needs in 2003 or newer version .