TextSelection TextSelection TextSelection TextSelection Class

Definition

Encapsulates the selection state for the RichTextBox control.

public ref class TextSelection sealed : System::Windows::Documents::TextRange
public sealed class TextSelection : System.Windows.Documents.TextRange
type TextSelection = class
    inherit TextRange
Public NotInheritable Class TextSelection
Inherits TextRange
Inheritance
TextSelectionTextSelectionTextSelectionTextSelection

Remarks

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

Methods

ApplyPropertyValue(DependencyProperty, Object) ApplyPropertyValue(DependencyProperty, Object) ApplyPropertyValue(DependencyProperty, Object) ApplyPropertyValue(DependencyProperty, Object)

Applies a specified formatting property and value to the current selection.

(Inherited from TextRange)

CanLoad(String) CanLoad(String) CanLoad(String) CanLoad(String)

Checks whether the current selection can be loaded with content in a specified data format.

(Inherited from TextRange)

CanSave(String) CanSave(String) CanSave(String) CanSave(String)

Checks whether the current selection can be saved as a specified data format.

(Inherited from TextRange)

ClearAllProperties() ClearAllProperties() ClearAllProperties() ClearAllProperties()

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

(Inherited from TextRange)

Contains(TextPointer) Contains(TextPointer) Contains(TextPointer) Contains(TextPointer)

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

(Inherited from TextRange)

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)

GetPropertyValue(DependencyProperty) GetPropertyValue(DependencyProperty) GetPropertyValue(DependencyProperty) GetPropertyValue(DependencyProperty)

Returns the effective value of a specified formatting property on the current selection.

(Inherited from TextRange)

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)

Load(Stream, String) Load(Stream, String) Load(Stream, String) Load(Stream, String)

Loads the current selection in a specified data format from a specified stream.

(Inherited from TextRange)

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)

Save(Stream, String) Save(Stream, String) Save(Stream, String) Save(Stream, String)

Saves the current selection to a specified stream in a specified data format.

(Inherited from TextRange)

Save(Stream, String, Boolean) Save(Stream, String, Boolean) Save(Stream, String, Boolean) Save(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)

Select(TextPointer, TextPointer) Select(TextPointer, TextPointer) Select(TextPointer, TextPointer) Select(TextPointer, TextPointer)

Updates the current selection, taking two TextPointer positions to indicate the updated selection.

(Inherited from TextRange)

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Events

Changed Changed Changed Changed

Occurs when the range is repositioned to cover a new span of content.

(Inherited from TextRange)

Properties

End End End End

Get the position that marks the end of the current selection.

(Inherited from TextRange)

IsEmpty IsEmpty IsEmpty IsEmpty

Gets a value indicating whether or not the current selection is empty.

(Inherited from TextRange)

Start Start Start Start

Gets the position that marks the beginning of the current selection.

(Inherited from TextRange)

Text Text Text Text

Gets or sets the plain text contents of the current selection.

(Inherited from TextRange)

Applies to