---
title: "ErrorProvider Control  in C#.Net"  
description: "ErrorProvider  simplifies and streamlineserror presentation. It is an abstraction that  shows errors on your form. It does not require a lot of work o"  
author: "Anonymous User"  
published: 2011-01-24  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/422/errorprovider-control-in-c-sharp-dot-net  
category: "c#"  
tags: ["c#"]  
reading_time: 2 minutes  

---

# ErrorProvider Control  in C#.Net

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](https://www.mindstick.com/mindstickarticle/70dff975-5062-4651-bc02-78355372883f/images/4ccc0c1a-4237-4481-bb32-6fee4d92afa2.png)\

![ErrorProvider Control in c#.net](https://www.mindstick.com/mindstickarticle/70dff975-5062-4651-bc02-78355372883f/images/e762a280-992b-4016-b360-495fe1498328.png)

##### Code:

Write code on Button click event.

![ErrorProvider Control in c#.net](https://www.mindstick.com/mindstickarticle/70dff975-5062-4651-bc02-78355372883f/images/48d7eeb1-ab81-48dc-9b65-4a6eb8091d7d.png)

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](https://www.mindstick.com/mindstickarticle/70dff975-5062-4651-bc02-78355372883f/images/d6622c8d-2dd3-48a3-ad48-995b54185285.png)

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

![ErrorProvider Control in c#.net](https://www.mindstick.com/mindstickarticle/70dff975-5062-4651-bc02-78355372883f/images/2f6a35ff-7d60-433f-b175-ab0e57f185d0.png)

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

![ErrorProvider Control in c#.net](https://www.mindstick.com/mindstickarticle/70dff975-5062-4651-bc02-78355372883f/images/3c1bb4ed-f223-4afb-b263-686a435cc2d6.png)\

##### 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

\

---

Original Source: https://www.mindstick.com/articles/422/errorprovider-control-in-c-sharp-dot-net

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
