textbox
-
Hi Dear I use VS2005 (ASP.NET 2) In TextBox or MaskedTextBox i want to show numbers with thousand separator like this : 12,254,236 but when i use the mask like 000,000,000 my number shown as 122,542,36 How can i solve the problem?
Hi, you can use the TextChanged event to first parse the string so you know the numeric value (use a format that allows for separators), then replace the text by the number in the format you want. But that is bound to be ugly, as soon as you edit a digit in the middle of the number, the cursor position and/or selection will act weird. Better approach is to keep the TextBox content as is, and have a Label next to the TextBox, and have that show the number in the format you want. :)
Luc Pattyn [Forum Guidelines] [My Articles]
Avoiding unwanted divs (as in "articles needing approval") with the help of this FireFox add-in