Length Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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; }Public Property Length As IntegerExamples
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}");textControl.Text = "Quarterly results" & vbCrLf & "Revenue increased by 12%."
textControl.Select(0, 17)
Dim selection As 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.