Returns or sets a value that determines how the control's contents will be copied to the clipboard when data masking is in enabled.
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
'Declaration
Public Property ClipMode As MaskMode
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 + "'" );
}
'Declaration
Public Property ClipMode As MaskMode
<igEditors:XamMaskedEditor x:Name="maskedEditor1" />
'Declaration
Public Property ClipMode As MaskMode
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