MaskedTextBox.CutCopyMaskFormat Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Gets or sets a value that determines whether literals and prompt characters are copied to the clipboard.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

member CutCopyMaskFormat : MaskFormat with get, set

Property Value

Type: System.Windows.Forms.MaskFormat

One of the MaskFormat values. The default is IncludeLiterals.

Exception Condition

Property set with a MaskFormat value that is not valid.

The CutCopyMaskFormat property determines how text, selected within the MaskedTextBox control, is interpreted when it is copied to the clipboard or retrieved through the SelectedText property. Specifically, it determines whether literal characters, prompt characters, or both are included when selected text is accessed. When prompt characters are excluded, they are transformed into spaces in the copied string.


The TextMaskFormat property serves a similar purpose with respect to how the Text property is interpreted.

.NET Framework
Available since 2.0
Return to top