TX Text Control .NET Server

HighlightMode Property

Property|Introduced in 23.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.Core.SDK as TXTextControl.Core.dll from the private NuGet feed or Text Control Offline Packages
Also in
TXTextControl.TextControl.ASP.SDK as TXTextControl.dll

Description

Gets or sets a value indicating when the subtextpart is highlighted.

Syntax

public HighlightMode HighlightMode { get; set; }

Members

ValueDescription
AutoThis value is not used for subtextparts.
ActivatedThe subtextpart is only highlighted, when it contains the current text input position and when the control has the input focus.
AlwaysThe subtextpart is always highlighted.
NeverThe subtextpart is never highlighted.

Examples

The following example marks the selected customer name as a named document region by using SubTextPart.HighlightMode.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPart subTextPart = new("CustomerName", 10);
textControl.SubTextParts.Add(subTextPart);

subTextPart.HighlightMode = HighlightMode.Never;
Console.WriteLine($"Highlight Mode used by Sub Text Part: {subTextPart.HighlightMode}");