TX Text Control .NET for WPF

HighlightColor Property

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

Description

Gets or sets the highlight color for the commented text. If the highlight color is CommentedText.DefaultHighlightColor, the highlight color is set to a color depending on the user name. The current user is the first string set with the TextControl.UserNames property.

Syntax

public Color HighlightColor { get; set; }

Examples

The following example attaches a reviewer comment to selected contract text by using CommentedText.HighlightColor.

textControl.Text = "Payment is due within 30 days.";
textControl.Select(0, textControl.Text.Length);
CommentedText commentedText = new("Verify the payment term.");
textControl.Comments.Add(commentedText);

commentedText.HighlightColor = System.Drawing.Color.LightSteelBlue;
Console.WriteLine($"Highlight Color used by Commented Text: {commentedText.HighlightColor}");