TX Text Control .NET for WPF

Length Property

Property
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Returns or sets the number of characters selected. If this property is zero, no text is selected and the Start property determines the current text input position. To select parts of a table, the Table.Select, TableRow.Select, TableColumn.Select and TableCell.Select methods must be used.

Syntax

public int Length { get; set; }

Examples

The following example formats the heading of a short document by using Selection.Length.

textControl.Text = "Quarterly results\nRevenue increased by 12%.";
textControl.Select(0, 17);
Selection selection = textControl.Selection;

selection.Length = 1;
Console.WriteLine($"Length used by Selection: {selection.Length}");

Limitations

Runtime only.

Remarks

If the Start property is set to zero and the Length property is set to int.MaxValue all the text is selected.