winform文本框验证问题
我在文本框中输入值后直接点击按钮能先验证文本框中的值吗?求解???
2014-03-29 14:42
程序代码: private void button1_Click(object sender, EventArgs e)
{
String txt = this.txt.Text.Trim();
if (txt == "")
{
MessageBox.Show("文本框无值");
}else
{
MessageBox.Show("文本框有值");
}
}
2014-03-29 18:54
程序代码: private void button1_Click(object sender, EventArgs e)
{
String txt = this.txt.Text.Trim();
if (txt == "")
{
MessageBox.Show("文本框无值");
}else
{
MessageBox.Show("文本框有值");
}
}
2014-03-29 18:55
程序代码: private void button1_Click(object sender, EventArgs e)
{
String txt = this.txt.Text.Trim();
if (txt == "")
{
MessageBox.Show("文本框无值");
}else
{
MessageBox.Show("文本框有值");
}
}
2014-03-29 18:55
2014-03-31 17:27
2014-05-14 22:19
2014-05-15 02:07