Version

ClipMode Property

Returns or sets a value that determines how the control's contents will be copied to the clipboard when data masking is in enabled.
Syntax
'Declaration
 
Public Property ClipMode As MaskMode
public MaskMode ClipMode {get; set;}
Remarks

This property is used to determine how mask literals and prompt characters are handled when the control's contents are copied to the clipboard. 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).

Example
The following code demonstrates ClipMode property of the XamMaskedEditor. The ClipMode controls how SelectedText property works and what gets copied into the clipboard when performing a copy operation on the editor. The following code sets ClipMode property to different values and prints out the respective SelectedText property values. The printed out values are what would get copied to the clipboard when performing copy operation. Also take a note of the fact that the value of the masked editor is set to a partial value. In other words, not all of the mask characters are filled.

Private Sub Button1_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    Me.maskedEditor1.Mask = "###-##-####"
    Me.maskedEditor1.Value = "111-22-"
    Me.maskedEditor1.StartEditMode()
    Me.maskedEditor1.SelectAll()

    Me.maskedEditor1.ClipMode = MaskMode.Raw
    Debug.WriteLine("SelectedText with Raw clip mode = '" & Me.maskedEditor1.SelectedText & "'")

    Me.maskedEditor1.ClipMode = MaskMode.IncludeLiterals
    Debug.WriteLine("SelectedText with IncludeLiterals clip mode = '" & Me.maskedEditor1.SelectedText & "'")

    Me.maskedEditor1.ClipMode = MaskMode.IncludePromptChars
    Debug.WriteLine("SelectedText with IncludeLiterals clip mode = '" & Me.maskedEditor1.SelectedText & "'")

    Me.maskedEditor1.ClipMode = MaskMode.IncludeLiteralsWithPadding
    Debug.WriteLine("SelectedText with IncludeLiteralsWithPadding clip mode = '" & Me.maskedEditor1.SelectedText & "'")

    Me.maskedEditor1.ClipMode = MaskMode.IncludeBoth
    Debug.WriteLine("SelectedText with IncludeBoth clip mode = '" & Me.maskedEditor1.SelectedText & "'")
End Sub
public void button1_Click( object sender, RoutedEventArgs e )
{
	this.maskedEditor1.Mask = "###-##-####";
	this.maskedEditor1.Value = "111-22-";
	this.maskedEditor1.StartEditMode( );
	this.maskedEditor1.SelectAll( );
	
	this.maskedEditor1.ClipMode = MaskMode.Raw;
	Debug.WriteLine( "SelectedText with Raw clip mode = '" + this.maskedEditor1.SelectedText + "'" );

	this.maskedEditor1.ClipMode = MaskMode.IncludeLiterals;
	Debug.WriteLine( "SelectedText with IncludeLiterals clip mode = '" + this.maskedEditor1.SelectedText + "'" );

	this.maskedEditor1.ClipMode = MaskMode.IncludePromptChars;
	Debug.WriteLine( "SelectedText with IncludeLiterals clip mode = '" + this.maskedEditor1.SelectedText + "'" );

	this.maskedEditor1.ClipMode = MaskMode.IncludeLiteralsWithPadding;
	Debug.WriteLine( "SelectedText with IncludeLiteralsWithPadding clip mode = '" + this.maskedEditor1.SelectedText + "'" );

	this.maskedEditor1.ClipMode = MaskMode.IncludeBoth;
	Debug.WriteLine( "SelectedText with IncludeBoth clip mode = '" + this.maskedEditor1.SelectedText + "'" );
}
<igEditors:XamMaskedEditor x:Name="maskedEditor1"  />
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, 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