Price文本框不应接受000000之类的值 [英] The Price textbox shouldn't accept the values like 000000
本文介绍了Price文本框不应接受000000之类的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的项目中,我使用文本框输入项目的价格。我需要对00000这样的值进行验证,这意味着不应该接受多个零点。
我可以使用哪个验证控件。请帮我找到它。
In my project i am using a textbox for entering the Price of an item.I need to give a validation for the value like 00000, that means more than one zero shouldn''t accept..
which validation control i can use for this.please help me to find it.
推荐答案
private void textBox1_TextChanged(object sender, EventArgs e)
{
if (Convert.ToInt32(textBox1.Text.Trim()).Equals(0))
{
this.textBox1.Text = Convert.ToString(0) ;
}
}
这篇关于Price文本框不应接受000000之类的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文