我使用的是 C#.NET 3.5,但我的项目有问题.在 C# Windows 应用程序中,我想让 textbox
只接受数字.如果用户尝试输入字符,消息应该显示为请仅输入数字",并且在另一个文本框中它必须接受有效的 email id
消息,当它无效时应该出现.它必须显示无效的用户 ID.
I am using C#.NET 3.5, and I have a problem in my project. In C# Windows Application, I want to make a textbox
to accept only numbers. If user try to enter characters message should be appear like "please enter numbers only", and in another textbox it has to accept valid email id
message should appear when it is invalid. It has to show invalid user id.
我建议,你使用 MaskedTextBox:http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.aspx
I suggest, you use the MaskedTextBox: http://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.aspx
这篇关于C# 纯数字文本框控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!