MaskedTextBox.SelectedText Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets the current selection in the MaskedTextBox control.
public:
virtual property System::String ^ SelectedText { System::String ^ get(); void set(System::String ^ value); };
public override string SelectedText { get; set; }
member this.SelectedText : string with get, set
Public Overrides Property SelectedText As String
Property Value
The currently selected text as a String. If no text is currently selected, this property resolves to an empty string.
Remarks
Selections retrieved using this property are formatted according to the control's formatting properties, such as Mask, FormatProvider, TextMaskFormat and CutCopyMaskFormat. Selections set using this property behave like a Paste operation: each character is matched against the mask, and the MaskInputRejected event is raised for invalid characters. If CutCopyMaskFormat is true
, literals and prompt characters are allowed when setting SelectedText, and will be removed silently unless they violate the mask.