ErrorIconAlignment Enumeration
Specifies constants indicating the locations that an error icon can appear in relation to the control with an error.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
| Member name | Description | |
|---|---|---|
| BottomLeft | The icon appears aligned with the bottom of the control and the left of the control. | |
| BottomRight | The icon appears aligned with the bottom of the control and the right of the control. | |
| MiddleLeft | The icon appears aligned with the middle of the control and the left of the control. | |
| MiddleRight | The icon appears aligned with the middle of the control and the right of the control. | |
| TopLeft | The icon appears aligned with the top of the control and to the left of the control. | |
| TopRight | The icon appears aligned with the top of the control and to the right of the control. |
This enumeration is used by ErrorProvider.
The following example demonstrates using the ErrorProvider 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 ErrorProvider 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.
Available since 1.1