TX Text Control .NET for WPF

Selection Constructor

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

Description

Creates a new instance of the Selection class.

Syntax

Selection()

Creates an empty Selection object with all properties set to their default values.

public Selection();

Selection(int, int)

Creates an instance of the Selection class with the specified start value and length. All other properties are set to their default values.

public Selection(int start, int length);
ParameterDescription
start

Specifies the selection's start position.

length

Specifies the number of selected characters.

Examples

The following example creates a reusable selection format and applies it to the current report heading.

textControl.Text = "Quarterly results";
textControl.Select(0, textControl.Text.Length);
Selection selection = new() { Bold = true, FontSize = 280 };
textControl.Selection = selection;