Click here to Skip to main content
14,976,274 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to validate 10 Textbox in Windows form, When i click button there should be an individual error message for all the textbox which is empty.
How i can use the errorprovider for this. Please Help...
Posted

1 solution

if (TextBox1.Text="" || TextBox2.Text="")
{
if(TextBox1.Text="")
{
errorProvider1.SetError(TextBox1,"Enter Value Here");
}
if(TextBox2.Text="")
{
errorProvider1.SetError(TextBox2,"Enter Value Here");
}

}
else
{
errorProvider1.SetError(TextBox1,null);
errorProvider1.SetError(TextBox2,null);
}
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900