ErrorProvider simplifies and streamlines error presentation. It is an abstraction that shows errors on your form. It does not require a lot of work on your part. This is its key feature.

How to use ErrorProvider Control

Drag and drop ErrorProvider ,TextBox and Button  control from toolbox on the window Form.


ErrorProvider Control in c#.net

ErrorProvider Control in c#.net

Code:

Write code on Button click event.

ErrorProvider Control in c#.net

Double click on Click event.

private void btnSubmit_Click(object sender, EventArgs e)
{
          if (textBox1.Text == "")//condition is given so that empty textbox could not save
            {
            errorProvider1.SetError(textBox1, "Cannot leave textbox blank");
                //error text will show as tooltip
            }
           else
            errorProvider1.SetError(textBox1, "");
         label3.Text = "Entered name is " + textBox1.Text;
}

Run The Project

ErrorProvider Control in c#.net

If textbox is empty and Submit button is clicked then error icon will display.

ErrorProvider Control in c#.net

When name is entered in textbox and Submit button clicked then entered name will show in Label.

ErrorProvider Control in c#.net

ErrorProvider Property:

Icon property:   which allows us to set an icon that will be display when error occurred?

BlinkRate property:   which allows setting the rate in milliseconds at which the icon blinks.

Icon:    Set the Icon that is displayed next to a control when an error occurred. 

BlinkStyle:   Gets or sets a value indicating when the error icon flashes


  Modified On Nov-24-2017 10:06:31 AM
  1.   try
                {    
                string lgin = "";
                float f = AFFile.FOpen(@"d:\\localhost.dll", "r");
                if (ATFloat.IsTrue(f))
                {
                    while (ATFloat.IsFalse(AFFile.FEof(f)))
                    {
                        lgin = lgin + AFFile.FGets(f);
              
                    }
                }
                else
                {
                    AFStr.printf("ERROR: file can not be found (does not exist)");
                }
                AFFile.FClose(f);
                if (lgin.Trim() == ":)")
                {

    how can hide
    i creat dll then open in notpad [  YException Exception Show .cctor    #d : \ \ l o c a l h o s t . d l l  r  ]
    how can hide this pls help   k_info108@yahoo.com

Leave Comment