i need to hide the submit but if there is any error in validation. i'm using the below code where if i entered both the text boxes with characters and if i correct 1 of the text box the submit button turns visible! how to avoid it util all the errors are clear? Thank you
int num;
private void textBox5_TextChanged(object sender, EventArgs e)
{
bool isNum = int.TryParse(textBox5.Text.Trim(), out num);
if (!isNum)
{
button2.Visible = false;
errorProvider1.SetError(this.textBox5, "Please enter numbers");
}
else
{
button2.Visible = true;
errorProvider1.SetError(this.textBox5, "");
}
}
private void textBox6_TextChanged(object sender, EventArgs e)
{
bool isNum = int.TryParse(textBox6.Text.Trim(), out num);
if (!isNum)
{
button2.Visible = false;
errorProvider2.SetError(this.textBox6, "Please enter numbers");
}
else
{
button2.Visible = true;
errorProvider2.SetError(this.textBox6, "");
}
}