在文本框中只允许负号和正号 [英] Allow only negative and positive no in textbox
本文介绍了在文本框中只允许负号和正号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何允许在C#的文本框中仅输入负数和正数.
谢谢与问候
Mohd Wasif
Hi ,
How to allow to input only negative and positive number in a textbox in C#.
Thanks & Regards
Mohd Wasif
推荐答案
做到这一点的一种方法是处理TextChanged
事件,解析文本以查看其是否通过您的测试,并更新TextBox的>属性.
/ravi
One way to do this would be to handle theTextChanged
event, parse the text to see if it passes your test, and update theText
property of theTextBox
if necessary.
/ravi
这篇关于在文本框中只允许负号和正号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文