Version

MaskInput Property (UltraNumericEditor)

Returns or sets the input mask used by the control.
Syntax
'Declaration
 
Public Overrides Property MaskInput As String
public override string MaskInput {get; set;}
Remarks

When inputting data, placeholder characters are displayed, and the user can only replace a placeholder with a character that is of the same type as the one specified in the input mask. The control can distinguish between numeric and alphabetic characters for validation, but cannot validate for valid content, such as the correct month or time of day.

When data masking is enabled, the MaskClipMode property determines how the control's contents are copied to the clipboard, the MaskDataMode property specifies how the control's contents are returned by the Value property, and the MaskDisplayMode property indicates how cell values are displayed.

Character

Description

{double:i.f:c} {double:i.f:c} is a place holder for a mask that allows floating point input where i and f in i.f specify the number of digits in the integer and fraction portions respectively. The :c portion of the mask is optional and it specifies that the inputting of the value should be done continous across fraction and integer portions. For example, with :c in the mask, in order to enter 12.34 the user types in "1234". Notice that the decimal separator character is missing. This allevietes the user from having to type in the decimal separator.
{double:-i.f:c} Same as {double:i.f:c} except this allows negative numbers.
{currency:i.f:c} Same as {double:i.f:c} except the mask is constructed based on currency formatting information of the underlying format provider or the culture. It typically has the currency symbol and also displays the group characters.
{currency:-i.f:c} Same as {currency:i.f:c} except this allows negative numbers.

.

Decimal placeholder. The actual character used is the one specified as the decimal placeholder by the system's international settings. This character is treated as a literal for masking purposes.

,

Thousands separator. The actual character used is the one specified as the thousands separator by the system's international settings. This character is treated as a literal for masking purposes.

- Minus sign when followed by a number section defined by series of 'n's (like in "-nn,nnn.nn") indicates that negative numbers are allowed. When not followed by a series of 'n's, it's taken as a literal. Minus sign will only be shown when the number is actually negative.
+ Plus sign when followed by a number section defined by series of 'n's (like in "-nn,nnn.nn") indicates that negative numbers are allowed. However, it differs from '-' in the respect that it will always show a '+' or a '-' sign depending on whether the number is positive or negative.
n Digit placeholder. A group of n's can be used to create a numeric section where numbers are entered from right to left. Character must be numeric (0-9) but entry is not required.
Literal All other symbols are displayed as literals; that is, they appear as themselves.

Example
This sample sets the Min and Max values of the numeric editor as well as the initial value in the forms load event. It also sets the corresponding properties to allow the text to be nullable. At which point the string "empty" will appear in the text portion. It sets the input mask, and the type to double.

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

Me.UltraCurrencyEditor1.MaxValue = 10000
Me.UltraCurrencyEditor1.MinValue = 0
Me.UltraCurrencyEditor1.Value = 500
Me.UltraNumericEditor1.Nullable = True 
Me.UltraNumericEditor1.NullText = "empty"
Me.UltraNumericEditor1.MaskInput = "####"
Me.UltraNumericEditor1.NumericType = Infragistics.Win.UltraWinEditors.NumericType.Double

 End Sub
private void Form1_Load(object sender, System.EventArgs e)
  {

	this.UltraCurrencyEditor1.MaxValue = 10000;
	this.UltraCurrencyEditor1.MinValue = 0;
	this.UltraCurrencyEditor1.Value = 500;
	this.UltraNumericEditor1.Nullable = true ;
	this.UltraNumericEditor1.NullText = "empty";
	this.UltraNumericEditor1.MaskInput = "####";
	this.UltraNumericEditor1.NumericType = Infragistics.Win.UltraWinEditors.NumericType.Double;

}
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