我有一个表格检查几个文本框不为空。如果其中任何一个是,它应该显示一个消息框,重置文本框并让用户重试。我相信我在检查文本框错误。我怎样才能做到这一点?谢谢。
public void ShowPaths()
{
if (textBox1.Text == null | textBox2.Text == null)
{
MessageBox.Show("Please enter a Project Name and Number");
}
else
{
sm.projNumber = textBox1.Text;
sm.projName = textBox2.Text;
textBox3.Text = sm.Root("s");
textBox4.Text = sm.Root("t");
}
textBox1.ResetText();
textBox2.ResetText();
}