'Declaration Public Event ValidationError As UltraNumericEditorBase.ValidationErrorEventHandler
public event UltraNumericEditorBase.ValidationErrorEventHandler ValidationError
The event handler receives an argument of type Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs containing data related to this event. The following ValidationErrorEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Beep | |
InvalidText | |
LastValidValue | |
RetainFocus |
The ValidationError event provides the ability to customize the way the control reacts when it loses focus with an invalid value.
The Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs class exposes the following properties to accomplish this:
Imports Infragistics.Win Imports Infragistics.Win.UltraWinEditors Private Sub UltraNumericEditor1_ValidationError(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs) Handles UltraNumericEditor1.ValidationError ' Set the Beep property to false to prevent the system beep ' sound from being generated when there is a validation error e.Beep = False ' Set the RetainFocus property to false so we don't ' keep the focus when there is a validation error e.RetainFocus = False ' Restore the last valid value Me.UltraNumericEditor1.Value = e.LastValidValue End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinEditors; private void ultraNumericEditor1_ValidationError(object sender, Infragistics.Win.UltraWinEditors.ValidationErrorEventArgs e) { // Set the Beep property to false to prevent the system beep // sound from being generated when there is a validation error e.Beep = false; // Set the RetainFocus property to false so we don't // keep the focus when there is a validation error e.RetainFocus = false; // Restore the last valid value this.ultraNumericEditor1.Value = e.LastValidValue; }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2