TX Text Control .NET Server

Selection Class

Class|Introduced in 22.0
Namespace
TXTextControl.Web
Package
TXTextControl.Web from nuget.org, the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.Web.DocumentEditor.dll
Install
dotnet add package TXTextControl.Web

Description

The Web.Selection class describes and handles the position and length of a text selection. It also provides the possibility to replace the currently selected text with text in a certain document format.

Syntax

public class Selection

Examples

The following example creates a Selection object and prepares it for a document workflow.

TXTextControl.Web.Selection selection = new();
Console.WriteLine("Selection is ready for the document workflow.");

Members

Constructors

ConstructorDescription
SelectionCreates a new instance of the Web.Selection class.

Properties

PropertyDescription
LengthReturns the number of characters selected. If this property is zero, no text is selected and the Start property determines the current text input position.
StartGets the starting point of selected text. The first possible position is 0.

Methods

MethodDescription
LoadExchanges the currently selected text with text in a certain format.
SaveSaves the selected text of a document with the specified format.