This documentation is archived and is not being maintained.
TextSelection Class
Visual Studio 2010
Encapsulates the selection state for the RichTextBox control.
Assembly: PresentationFramework (in PresentationFramework.dll)
The TextSelection type exposes the following members.
| Name | Description | |
|---|---|---|
![]() | End | Get the position that marks the end of the current selection. (Inherited from TextRange.) |
![]() | IsEmpty | Gets a value indicating whether or not the current selection is empty. (Inherited from TextRange.) |
![]() | Start | Gets the position that marks the beginning of the current selection. (Inherited from TextRange.) |
![]() | Text | Gets or sets the plain text contents of the current selection. (Inherited from TextRange.) |
| Name | Description | |
|---|---|---|
![]() | ApplyPropertyValue | Applies a specified formatting property and value to the current selection. (Inherited from TextRange.) |
![]() | CanLoad | Checks whether the current selection can be loaded with content in a specified data format. (Inherited from TextRange.) |
![]() | CanSave | Checks whether the current selection can be saved as a specified data format. (Inherited from TextRange.) |
![]() | ClearAllProperties | Removes all formatting properties (represented by Inline elements) from the current selection. (Inherited from TextRange.) |
![]() | Contains | Checks whether a position (specified by a TextPointer) is located within the current selection. (Inherited from TextRange.) |
![]() | Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) |
![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) |
![]() | GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) |
![]() | GetPropertyValue | Returns the effective value of a specified formatting property on the current selection. (Inherited from TextRange.) |
![]() | GetType | Gets the Type of the current instance. (Inherited from Object.) |
![]() | Load | Loads the current selection in a specified data format from a specified stream. (Inherited from TextRange.) |
![]() | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) |
![]() | Save(Stream, String) | Saves the current selection to a specified stream in a specified data format. (Inherited from TextRange.) |
![]() | 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 | Updates the current selection, taking two TextPointer positions to indicate the updated selection. (Inherited from TextRange.) |
![]() | ToString | Returns a string that represents the current object. (Inherited from Object.) |
This type has no public constructor, but is exposed via a public property defined by RichTextBox.
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.
Show:
