Version

OnInvalidChar Method

Fires InvalidChar event. This method is usually called when the user tries to enter a character and the character does not match the mask at the current input position.
Syntax
'Declaration
 
Protected Overridable Sub OnInvalidChar( _
   ByVal e As Infragistics.Win.UltraWinMaskedEdit.InvalidCharEventArgs _
) 
protected virtual void OnInvalidChar( 
   Infragistics.Win.UltraWinMaskedEdit.InvalidCharEventArgs e
)

Parameters

e
Remarks
For example, when the input mask is "####" and the user types in a non-digit character, this method will be called and InvalidChar event is fired. You can override this method or hook into InvalidChar to alter the default masked edit behavior which is to beep.
Example
Following code shows properties available in InvalidChar event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinMaskedEdit

  Private Sub UltraMaskedEdit1_InvalidChar(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinMaskedEdit.InvalidCharEventArgs) Handles ultraMaskedEdit1.InvalidChar
      ' InvalidChar gets fired when the user types in a character that doesn't
      ' match the mask.

      ' You can change the masked edit's default behaviour of beeping by setting the
      ' Beep to false.
      e.Beep = False
  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinMaskedEdit;
using System.Diagnostics;

private void ultraMaskedEdit1_InvalidChar(object sender, Infragistics.Win.UltraWinMaskedEdit.InvalidCharEventArgs e)
{
	// InvalidChar gets fired when the user types in a character that doesn't
	// match the mask.

	// You can change the masked edit's default behaviour of beeping by setting the
	// Beep to false.
	e.Beep = false;
}
Requirements

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

See Also