System.Windows.Forms.RichTextBox.SelectionProtected Property

Gets or sets a value indicating whether the current text selection is protected.


public bool SelectionProtected { set; get; }


Documentation for this section has not yet been entered.


If no text is currently selected, the protection setting is applied to the paragraph in which the insertion point appears and to all text that is typed into the control after the insertion point. The protection setting applies until the property is changed to a different value or until the insertion point is moved to a different paragraph within the control.

If text is selected within the control, the selected text and any text entered after the text selection will have the value of this property applied to it. You can use this property to prevent the user from modifying sections of text within the control.

If this property is set to true, the RichTextBox.Protected event is raised when the user attempts to change the current text selection.


This property will return true only if the entire selection within the control contains protected content.


Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0,