Version

EditAs Property

Specifies whether the control should use a commonly-used data mask, should use a pre-specified data mask, or should auto-sense the type of data mask required.
Syntax
'Declaration
 
Public Property EditAs As EditAsType
public EditAsType EditAs {get; set;}
Remarks

When this property is set to one of the pre-defined mask types, the input mask is set to appropriate string. Pre-defined mask types include Currency, Date, Time, Date/Time, Double, Integer and String.

If this property is set to AutoSense, an input mask will be derived from the type of the data field bound to the control. If this property is set to UseSpecifiedMask, the mask specified by the InputMask property will be used.

Note that if the InputMask property is set to a valid mask string, this property will automatically be changed to UseSpecifiedMask.

Note that this propery needs to be set on UltraMaskedEdit if Infragistics.Win.UltraWinEditors.EditorButtonControlBase.DataFilter is used for conversions between Owner and Editor. UltraMaskedEdit will use specified type to set default mask in editor constructor.

Example
Following code sets some of the commonly used properties of UltraMaskedEdit in the Form's Load event

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

  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

      ' Set the InputMask to the desired mask.
      Me.UltraMaskedEdit1.EditAs = EditAsType.Currency

      ' Optionally assign a culture to CultureInfo property.
      Me.UltraMaskedEdit1.CultureInfo = System.Globalization.CultureInfo.CreateSpecificCulture("en-GB")

      ' Optinally assign a DisplayStyle to desired display style.
      Me.UltraMaskedEdit1.DisplayStyle = EmbeddableElementDisplayStyle.OfficeXP

      ' Set the main appearance by using Appearance property.			
      Me.UltraMaskedEdit1.Appearance.TextHAlign = HAlign.Right
      Me.UltraMaskedEdit1.Appearance.FontData.Bold = DefaultableBoolean.True
      Me.UltraMaskedEdit1.Appearance.ForeColor = Color.DarkBlue

      ' Set the highlight colors. These colors get applied to the selected text
      ' in the masked edit.
      Me.UltraMaskedEdit1.SelectedTextBackColor = Color.LightBlue
      Me.UltraMaskedEdit1.SelectedTextForeColor = Color.Yellow

      ' Set the colors of the prompt and literal characters.
      Me.UltraMaskedEdit1.PromptCharacterAppearance.ForeColor = Color.Red
      Me.UltraMaskedEdit1.MaskLiteralsAppearance.ForeColor = Color.Green

      ' Set the Nullable to false and NullText to an appropriate string.
      Me.UltraMaskedEdit1.Nullable = False
  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinMaskedEdit;
using System.Diagnostics;

private void Form1_Load(object sender, System.EventArgs e)
{
	// Set the InputMask to the desired mask.
	this.ultraMaskedEdit1.EditAs = EditAsType.Currency;

	// Optionally assign a culture to CultureInfo property.
	this.ultraMaskedEdit1.CultureInfo = System.Globalization.CultureInfo.CreateSpecificCulture( "en-GB" );

	// Optinally assign a DisplayStyle to desired display style.
	this.ultraMaskedEdit1.DisplayStyle = EmbeddableElementDisplayStyle.OfficeXP;

	// Set the main appearance by using Appearance property.			
	this.ultraMaskedEdit1.Appearance.TextHAlign = HAlign.Right;
	this.ultraMaskedEdit1.Appearance.FontData.Bold = DefaultableBoolean.True;
	this.ultraMaskedEdit1.Appearance.ForeColor = Color.DarkBlue;

	// Set the highlight colors. These colors get applied to the selected text
	// in the masked edit.
	this.ultraMaskedEdit1.SelectedTextBackColor = Color.LightBlue;
	this.ultraMaskedEdit1.SelectedTextForeColor = Color.Yellow;

	// Set the colors of the prompt and literal characters.
	this.ultraMaskedEdit1.PromptCharacterAppearance.ForeColor = Color.Red;
	this.ultraMaskedEdit1.MaskLiteralsAppearance.ForeColor = Color.Green;

	// Set the Nullable to false and NullText to an appropriate string.
	this.ultraMaskedEdit1.Nullable = 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