Export (0) Print
Expand All

TextSelection Class

Encapsulates the selection state for the RichTextBox control.

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

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

public ref class TextSelection sealed : public TextRange

The TextSelection type exposes the following members.

  NameDescription
Public propertyEndGet the position that marks the end of the current selection. (Inherited from TextRange.)
Public propertyIsEmptyGets a value indicating whether or not the current selection is empty. (Inherited from TextRange.)
Public propertyStartGets the position that marks the beginning of the current selection. (Inherited from TextRange.)
Public propertyTextGets or sets the plain text contents of the current selection. (Inherited from TextRange.)
Top

  NameDescription
Public methodApplyPropertyValueApplies a specified formatting property and value to the current selection. (Inherited from TextRange.)
Public methodCanLoadChecks whether the current selection can be loaded with content in a specified data format. (Inherited from TextRange.)
Public methodCanSaveChecks whether the current selection can be saved as a specified data format. (Inherited from TextRange.)
Public methodClearAllPropertiesRemoves all formatting properties (represented by Inline elements) from the current selection. (Inherited from TextRange.)
Public methodContainsChecks whether a position (specified by a TextPointer) is located within the current selection. (Inherited from TextRange.)
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetPropertyValueReturns the effective value of a specified formatting property on the current selection. (Inherited from TextRange.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodLoadLoads the current selection in a specified data format from a specified stream. (Inherited from TextRange.)
Public methodSave(Stream, String)Saves the current selection to a specified stream in a specified data format. (Inherited from TextRange.)
Public methodSave(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.)
Public methodSelectUpdates the current selection, taking two TextPointer positions to indicate the updated selection. (Inherited from TextRange.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

  NameDescription
Public eventChangedOccurs when the range is repositioned to cover a new span of content. (Inherited from TextRange.)
Top

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

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

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