Click here to Skip to main content
15,913,685 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

When I enter digits, it will show like this: 123456789
but I want to seperate 3 by 3 digits as user enters digits(like calculator in windows):123,456,789
Posted
Updated 29-Sep-12 21:09pm
v2

Not too clear if you are talking of web or winforms.

For either case, I would go for a masked textbox, samples:
Web:
Enhanced Textbox Control[^]

Winforms:
Masked C# TextBox Control[^]
MSDN: Walkthrough: Working with the MaskedTextBox Control[^]
 
Share this answer
 
Comments
FM7 30-Sep-12 2:37am    
c# windows forms,please
Sandeep Mewara 30-Sep-12 2:52am    
2 links exactly for C# winforms already shared! :doh:

Look at them, learn and implement.
Here, from the Micrrosoft documentation:
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx[^]

Look perticulat at this example:
C#
value = 1234.567890;
Console.WriteLine(value.ToString("0,0.00", CultureInfo.InvariantCulture));
// Displays 1,234.57
 
Share this answer
 
Comments
FM7 30-Sep-12 2:39am    
ok.right.but i want to seperate digits just in time we enter digits.is it possible?
Kenneth Haugland 30-Sep-12 2:48am    
Yes. WinfForms:
http://social.msdn.microsoft.com/Forums/en/winforms/thread/7300d00e-b91e-4e76-bdc5-e3c90d93c803
Reza Shahhosseini 3-Apr-17 9:25am    
LIKE! I'm looking for this, too

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900