RichTextBox.Selection Property

 

Gets a TextSelection object containing the current selection in the RichTextBox.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

member Selection : TextSelection with get

Property Value

Type: System.Windows.Documents.TextSelection

A TextSelection object containing the current selection in the RichTextBox.

The default returned TextSelection has an IsEmpty property value of True. An empty TextSelection renders as a caret in the text area with no selection.

Use the Select method to programmatically select content.

The following example illustrates the use of this property.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Return to top
Show: