'Declaration Public Property DataMode As Infragistics.Win.UltraWinMaskedEdit.MaskMode
public Infragistics.Win.UltraWinMaskedEdit.MaskMode DataMode {get; set;}
This property is used to determine how mask literals and prompt characters are handled when the control's contents are passed to the data source (or are retrieved using the Text property.) Based on the setting of this property, the text of the control will contain no prompt characters or literals (just the raw data), the data and just the literals, the data and just the prompt characters, or all the text including both prompt characters and literals. The formatted spacing of partially masked values can be preserved by indicating to include literals with padding, which includes data and literal characters, but replaces prompt characters with pad characters (usually spaces).
Generally, simply the raw data is committed to the data source and data masking is used to format the data when it is displayed. In some cases, however, it may be appropriate in your application to store mask literals as well as data.
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.InputMask = "mm/dd/yyyy" ' Set the DisplayMode, DataMode and ClipMode to desired values. DataMode dictates ' what the Text property (and Value property if the data is string type), returns. ' DisplayMode effects what gets displayed when the masked edit doesn't have focus. ' ClipMode effects what gets copied to the clipboard when the user copies text ' from the UltraMaskedEdit. Me.ultraMaskedEdit1.DataMode = MaskMode.IncludeLiterals Me.ultraMaskedEdit1.DisplayMode = MaskMode.IncludeLiterals Me.ultraMaskedEdit1.ClipMode = MaskMode.IncludeBoth ' If you want to show the spin buttons, set the SpinButtonDisplayStyle to either ' OnRight or OnLeft. Spin buttons allow the user to conveniently increment or ' decrement a number section. It only works in numeric sections or date-time ' sections. Me.ultraMaskedEdit1.SpinButtonDisplayStyle = SpinButtonDisplayStyle.OnRight ' You can also set the style of the spin buttons. Me.ultraMaskedEdit1.SpinButtonStyle = UIElementButtonStyle.PopupBorderless ' Set the border style to desired border style. Me.ultraMaskedEdit1.BorderStyle = UIElementBorderStyle.InsetSoft ' Set the DisplayStyle to desired display style. BorderStyle property settings ' will be ignored if you set the DisplayStyle to something other than Standard. Me.ultraMaskedEdit1.DisplayStyle = EmbeddableElementDisplayStyle.Standard ' Set the PromptChar to a desired character. Default is "_" (underscore character). Me.ultraMaskedEdit1.PromptChar = "_" ' Set the PadChar to desired character. Default is " " (space character). Me.ultraMaskedEdit1.PadChar = " " ' You can set the padding in pixels around the text inside the masked edit. ' Default is 1. Me.ultraMaskedEdit1.Padding = 2 ' Optionally assign an initialial value by setting the Value property. Me.ultraMaskedEdit1.Value = DateTime.Now ' Set the MinValue and MaxValues. The user input that doesn't satisfy these ' min and max criteria is considered to be an invalid input and masked edit ' will fire MaskValidationError if the user tries to leave the control with ' such an input. Me.ultraMaskedEdit1.MinValue = New DateTime(1990, 1, 1) Me.ultraMaskedEdit1.MaxValue = New DateTime(2010, 12, 31) ' The SpinWrap property gets/sets a value indicating whether the control's spin button ' should wrap the value of a spinnable section. If true the spin button will wrap the ' value incremented/decremented based on its Min/Max value. Me.ultraMaskedEdit1.SpinWrap = True 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.InputMask = "mm/dd/yyyy"; // Set the DisplayMode, DataMode and ClipMode to desired values. DataMode dictates // what the Text property (and Value property if the data is string type), returns. // DisplayMode effects what gets displayed when the masked edit doesn't have focus. // ClipMode effects what gets copied to the clipboard when the user copies text // from the UltraMaskedEdit. this.ultraMaskedEdit1.DataMode = MaskMode.IncludeLiterals; this.ultraMaskedEdit1.DisplayMode = MaskMode.IncludeLiterals; this.ultraMaskedEdit1.ClipMode = MaskMode.IncludeBoth; // If you want to show the spin buttons, set the SpinButtonDisplayStyle to either // OnRight or OnLeft. Spin buttons allow the user to conveniently increment or // decrement a number section. It only works in numeric sections or date-time // sections. this.ultraMaskedEdit1.SpinButtonDisplayStyle = SpinButtonDisplayStyle.OnRight; // You can also set the style of the spin buttons. this.ultraMaskedEdit1.SpinButtonStyle = UIElementButtonStyle.PopupBorderless; // Set the border style to desired border style. this.ultraMaskedEdit1.BorderStyle = UIElementBorderStyle.InsetSoft; // Set the DisplayStyle to desired display style. BorderStyle property settings // will be ignored if you set the DisplayStyle to something other than Standard. this.ultraMaskedEdit1.DisplayStyle = EmbeddableElementDisplayStyle.Standard; // Set the PromptChar to a desired character. Default is '_' (underscore character). this.ultraMaskedEdit1.PromptChar = '_'; // Set the PadChar to desired character. Default is ' ' (space character). this.ultraMaskedEdit1.PadChar = ' '; // You can set the padding in pixels around the text inside the masked edit. // Default is 1. this.ultraMaskedEdit1.Padding = 2; // Optionally assign an initialial value by setting the Value property. this.ultraMaskedEdit1.Value = DateTime.Now; // Set the MinValue and MaxValues. The user input that doesn't satisfy these // min and max criteria is considered to be an invalid input and masked edit // will fire MaskValidationError if the user tries to leave the control with // such an input. this.ultraMaskedEdit1.MinValue = new DateTime( 1990, 1, 1 ); this.ultraMaskedEdit1.MaxValue = new DateTime( 2010, 12, 31 ); // The SpinWrap property gets/sets a value indicating whether the control's spin button // should wrap the value of a spinnable section. If true the spin button will wrap the // value incremented/decremented based on its Min/Max value. this.ultraMaskedEdit1.SpinWrap = true; }
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