本文介绍了winform应用程序中的验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的应用程序有10个文本框和10个按钮,
每个文本框一键。
在文本框中输入数据按下按钮。
如此验证文本框。如何操作
以前的应用程序我写了验证,验证事件,在那个应用程序只有一个按钮,所以它工作,
但现在当我进入第一个文本框中的数据单击相应的按钮,然后其他文本框不满足条件,因此他们给出错误。
如何解决它。
Hi,
My application is having 10 textboxes and 10 buttons,
for each textbox one button.
enter the data in textbox press button .
so validate that textbox .how to do
in previous application i wrote validate, validating events ,in that appl only one button so it worked,
but now when i enter data in first textbox click corresponding button , then other textboxes r not satisfying the condition so they r giving error.
how to solve it.
推荐答案
public void btnSave_Click(object sender,EventArgs e)
{
if (txtNumber.Text != "" || txtNumber.Text != string.Empty)
{
}
else
{
MessagBox.Show("Please enter Number...!!! ");
}
}
这篇关于winform应用程序中的验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!