如何在文本框中将数字分组? [英] how to group numbre in a textbox?

查看:63
本文介绍了如何在文本框中将数字分组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在使用VS2010和C#编写代码,
我有一个仅接受数值的文本框,我希望它们按3分组.
范例:1 => 1
10000 => 10000等

感谢您的帮助.

Hi,

I am wirting a code using VS2010 and C#,
I have a textbox that accept only numeric value and i want them to be group by 3.
exemple: 1 =>1
10000 => 10 000, etc.

Thanks for ur help

推荐答案

如果用于网页,请尝试使用MaskedEditExtender.
下面是一个工作示例.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/MaskedEdit/MaskedEdit.aspx [ ^ ]

对于Windows应用程序:
http://www.c-sharpcorner.com/uploadfile/mahesh/maskedtextbox-in -C-Sharp/ [ ^ ]

一般:
http://stackoverflow.com/questions/1872094/how-to- display-numeric-in-3-digit-grouping [ ^ ]
http://stackoverflow.com/questions/7671148/textbox-display-formatting [ ^ ]
Try using MaskedEditExtender, if you are using for web page.
A working example is below.
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/MaskedEdit/MaskedEdit.aspx[^]

For windows application:
http://www.c-sharpcorner.com/uploadfile/mahesh/maskedtextbox-in-C-Sharp/[^]

General:
http://stackoverflow.com/questions/1872094/how-to-display-numeric-in-3-digit-grouping[^]
http://stackoverflow.com/questions/7671148/textbox-display-formatting[^]


这篇关于如何在文本框中将数字分组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆