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.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (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.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
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, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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.

Community Additions

ADD
Show:
© 2014 Microsoft