HighlightColor Property
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. Core. SDK TXTextControl.from the private NuGet feed or Text Control Offline PackagesCore. dll
- Also in
TXTextControl.asTextControl. ASP. SDK TXTextControl.dll
Description
Gets or sets the highlight color for the subtextpart. A subtextpart is highlighted, if it contains the current text input position. The color's alpha value must be less than 255 (opaque) so that the textpart's text remains visible. The default value is red with an alpha value of 60.
Syntax
public Color HighlightColor { get; set; }Public Property HighlightColor As ColorExamples
The following example marks the selected customer name as a named document region by using SubTextPart.HighlightColor.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
SubTextPart subTextPart = new("CustomerName", 10);
textControl.SubTextParts.Add(subTextPart);
subTextPart.HighlightColor = System.Drawing.Color.LightSteelBlue;
Console.WriteLine($"Highlight Color used by Sub Text Part: {subTextPart.HighlightColor}");textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim subTextPart As New SubTextPart("CustomerName", 10)
textControl.SubTextParts.Add(subTextPart)
subTextPart.HighlightColor = System.Drawing.Color.LightSteelBlue
Console.WriteLine($"Highlight Color used by Sub Text Part: {subTextPart.HighlightColor}")