Provides a user interface for indicating that a control on a form has an error associated with it.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Thetype exposes the following members.
|ErrorProvider()||Initializes a new instance of the class and initializes the default settings for BlinkRate, BlinkStyle, and the Icon.|
|ErrorProvider(ContainerControl)||Initializes a new instance of the class attached to a container.|
|ErrorProvider(IContainer)||Initializes a new instance of the class attached to an IContainer implementation.|
|BlinkRate||Gets or sets the rate at which the error icon flashes.|
|BlinkStyle||Gets or sets a value indicating when the error icon flashes.|
|CanRaiseEvents||Gets a value indicating whether the component can raise an event. (Inherited from Component.)|
|Container||Gets the IContainer that contains the Component. (Inherited from Component.)|
|ContainerControl||Gets or sets a value indicating the parent control for this .|
|DataMember||Gets or sets the list within a data source to monitor.|
|DataSource||Gets or sets the data source that the monitors.|
|DesignMode||Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component.)|
|Events||Gets the list of event handlers that are attached to this Component. (Inherited from Component.)|
|Icon||Gets or sets the Icon that is displayed next to a control when an error description string has been set for the control.|
|RightToLeft||Gets or sets a value that indicates whether the component is used in a locale that supports right-to-left fonts.|
|Site||Gets or sets the ISite of the Component. (Overrides Component.Site.)|
|Tag||Gets or sets an object that contains data about the component.|
|BindToDataAndErrors||Provides a method to set both the DataSource and DataMember at run time.|
|CanExtend||Gets a value indicating whether a control can be extended.|
|Clear||Clears all settings associated with this component.|
|CreateObjRef||Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.)|
|Dispose()||Releases all resources used by the Component. (Inherited from Component.)|
|Dispose(Boolean)||Releases the unmanaged resources used by the Component and optionally releases the managed resources. (Overrides Component.Dispose(Boolean).)|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|Finalize||Releases unmanaged resources and performs other cleanup operations before the Component is reclaimed by garbage collection. (Inherited from Component.)|
|GetError||Returns the current error description string for the specified control.|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetIconAlignment||Gets a value indicating where the error icon should be placed in relation to the control.|
|GetIconPadding||Returns the amount of extra space to leave next to the error icon.|
|GetLifetimeService||Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.)|
|GetService||Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|InitializeLifetimeService||Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.)|
|MemberwiseClone()||Creates a shallow copy of the current Object. (Inherited from Object.)|
|MemberwiseClone(Boolean)||Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.)|
|OnRightToLeftChanged||Raises the RightToLeftChanged event.|
|SetError||Sets the error description string for the specified control.|
|SetIconAlignment||Sets the location where the error icon should be placed in relation to the control.|
|SetIconPadding||Sets the amount of extra space to leave between the specified control and the error icon.|
|ToString||Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.)|
|UpdateBinding||Provides a method to update the bindings of the DataSource, DataMember, and the error text.|
presents a simple mechanism for indicating to the end user that a control on a form has an error associated with it. If an error description string is specified for the control, an icon appears next to the control. The icon flashes in the manner specified by BlinkStyle, at the rate specified by BlinkRate. When the mouse hovers over the icon, a ToolTip appears showing the error description string.
Typically, you use in association with data-bound controls. When using with data-bound controls, you must specify the ContainerControl, either in the constructor or by setting the ContainerControl property.
The component does not provide built-in support for accessibility clients. To make your application accessible when using this component, you must provide an additional, accessible feedback mechanism.
The following code example demonstrates using the class to notify the user of a data entry error. The example creates a Form that contains a TextBox control, a NumericUpDown control, and a ComboBox control, each validating its content, and an for each control. The example sets error icon options using the BlinkRate and BlinkStyle properties and the SetIconAlignment and SetIconPadding methods. The SetError method is called with or without appropriate error text during a control’s Validated event, depending upon the content in the control.
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.