TextSelection Class
TOC
Collapse the table of content
Expand the table of content

TextSelection Class

 

Encapsulates the selection state for the RichTextBox control.

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

System.Object
  System.Windows.Documents.TextRange
    System.Windows.Documents.TextSelection

public sealed class TextSelection : TextRange

NameDescription
System_CAPS_pubpropertyEnd

Get the position that marks the end of the current selection.(Inherited from TextRange.)

System_CAPS_pubpropertyIsEmpty

Gets a value indicating whether or not the current selection is empty.(Inherited from TextRange.)

System_CAPS_pubpropertyStart

Gets the position that marks the beginning of the current selection.(Inherited from TextRange.)

System_CAPS_pubpropertyText

Gets or sets the plain text contents of the current selection.(Inherited from TextRange.)

NameDescription
System_CAPS_pubmethodApplyPropertyValue(DependencyProperty, Object)

Applies a specified formatting property and value to the current selection.(Inherited from TextRange.)

System_CAPS_pubmethodCanLoad(String)

Checks whether the current selection can be loaded with content in a specified data format.(Inherited from TextRange.)

System_CAPS_pubmethodCanSave(String)

Checks whether the current selection can be saved as a specified data format.(Inherited from TextRange.)

System_CAPS_pubmethodClearAllProperties()

Removes all formatting properties (represented by Inline elements) from the current selection.(Inherited from TextRange.)

System_CAPS_pubmethodContains(TextPointer)

Checks whether a position (specified by a TextPointer) is located within the current selection.(Inherited from TextRange.)

System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetPropertyValue(DependencyProperty)

Returns the effective value of a specified formatting property on the current selection.(Inherited from TextRange.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodLoad(Stream, String)

Loads the current selection in a specified data format from a specified stream.(Inherited from TextRange.)

System_CAPS_pubmethodSave(Stream, String)

Saves the current selection to a specified stream in a specified data format.(Inherited from TextRange.)

System_CAPS_pubmethodSave(Stream, String, Boolean)

Saves the current selection to a specified stream in a specified data format, with the option of preserving custom TextElement objects.(Inherited from TextRange.)

System_CAPS_pubmethodSelect(TextPointer, TextPointer)

Updates the current selection, taking two TextPointer positions to indicate the updated selection.(Inherited from TextRange.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubeventChanged

Occurs when the range is repositioned to cover a new span of content.(Inherited from TextRange.)

This type has no public constructor, but is exposed via a public property defined by RichTextBox.

.NET Framework
Available since 3.0
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 7.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft