TextEdit.Mask Property

Gets or sets a mask expression. This is a dependency property.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public string Mask { get; set; }
Public Property Mask As String

Property Value

Type Description
String

A string representing a mask expression.

Remarks

When the editor's value is set using the Text property, the editor's value is of System.String type and the Numeric and DateTime mask types may apply incorrectly. Specify the editor's value using the EditValue property to correctly apply mask settings.

NOTE

The following TextEdit descendants do not support the masked input:

Specify Mask in Design Time

You can use the Mask Editor to specify editor's Mask.

Specify Mask in Code

<!-- Long date -->
<dxe:TextEdit Mask="D" MaskType="DateTime"
    MaskUseAsDisplayFormat="True" />
<!-- Currency -->
<dxe:TextEdit Mask="c" MaskType="Numeric"
    MaskUseAsDisplayFormat="True" />
<!-- Email address -->
<dxe:TextEdit Mask="[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}"
    MaskType="RegEx" MaskUseAsDisplayFormat="True" />

To learn more, see Masked Input.

See Also