Introduction
Today, I have provided an article showing you how to use the ErrorProvider control in a Windows Forms application. The ErrorProvider control provides a user interface to indicate to the user that a control on a form has an error associated with it, or the ErrorProvider component provides an easy way to set validation errors. Here, you will see a demo of the Errorprovider control with a ToolTip. When an error message is set, an icon indicating the error will appear next to the control and the error message is displayed as a ToolTip when the mouse is over the control. All you have to do is implement and hook it up to your application. First of all you create a Windows Forms application in Visual Studio 2010.
Now you have to create a Windows Forms application.
- Go to Visual Studio 2010
- New-> Select a project
- Click OK

Now add a new page to the Windows Forms application.
- Go to the Solution Explorer
- Right-click on the Project name
- Select add new item
- Add new windows Form and give it a name
- Click OK
First of all drag the TextBoxes control, Button and ErrorProvider control from the Toolbox on the form. The form looks like this:

Now select the ErrorProvider control and press F4 to set the the following property of the ErrorProvider control:
- Icon - Icon property are used to indicate an error.
- BlinkStyle - Controls whether the error icon blinks when an error is set.

Now suppose you do not write any text in the TextBoxes on the form and click on the Button; an icon will be displayed to the TextBoxes that show an error and the specified text will appear in the ToolTip box when the mouse is over the control. The code for that looks like this:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication4
{
public partial class ErrorProvider : Form
{






Rohatash KumareditedPosted Apr 14, 2013, 11:10 PMEdited Apr 14, 2013, 11:11 PM
Thanks LAX. if you think You can add more content related to the ErrorProvider Control. You can do it.
Lax LaxPosted Apr 12, 2013, 5:06 PM
i have followed you code, it does work but may be u have forgot to explain things like disposing the error. because as u can see once you fill one of the textboxes the errorprovider does not dissapear... have a look at the errorprovider1.dispose() method to uncheck the error thanks