我该如何强迫用户编写@ [英] how can I force user to write chracter such as @
本文介绍了我该如何强迫用户编写@的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用验证文本框强制用户在文本框中编写诸如@或:之类的文字
最好的问候
how can I force user to write chracter such as @ or : in textbox using validating textbox
best regards
推荐答案
有两种方法可以做到:您可以处理TextBox事件(TextChanged和Validating可能是您最常使用的事件),或者可以使用一个MaskedTextBox,它将允许您确切指定所需的输入.
There are two ways to do it: you can handle the TextBox events (TextChanged, and Validating are probably the most use to you) or you could use a MaskedTextBox which will allow you to specify exactly what input you need.
^ ]是有关文本框验证的非常简单的文章.
它应该给您足够的想法,以开始尝试针对此问题实施解决方案.
Here[^] is a very simple article on text box validation.
It should give you enough ideas to start trying to implement a solution for your this problem.
您好,
我认为您必须使用正则表达式验证文本框(接受的字符串格式符合正则表达式格式)
点击此链接可能会很有用 http://www.codeproject.com/KB/recipes/RegexTester.aspx
祝你好运
Hi,
i think you have to use Regular Expression to validate Textbox (accept string has format meets the regular expression format)
follow this link it may be useful http://www.codeproject.com/KB/recipes/RegexTester.aspx
good luck,
这篇关于我该如何强迫用户编写@的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文