# CommentedText.HighlightColor Property

> 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.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 30.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > CommentedText.HighlightColor Property
- **627 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/highlightcolor-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/highlightcolor-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/highlightcolor-property/llms-full.txt

---

### Description

Gets or sets the highlight color for the commented text. If the highlight color is [CommentedText.DefaultHighlightColor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/defaulthighlightcolor-property/llms-full.txt), 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](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/usernames-property/llms-full.txt) property.

### Syntax

```csharp
public Color HighlightColor { get; set; }
```

```vbnet
Public Property HighlightColor As Color
```

### Examples

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

```csharp
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}");
```

```vbnet
textControl.Text = "Payment is due within 30 days."
textControl.Select(0, textControl.Text.Length)
Dim commentedText As New CommentedText("Verify the payment term.")
textControl.Comments.Add(commentedText)

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

---

## Nearby

- **Previous:** [CommentedText.EditComment Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/editcomment-method/llms-full.txt)
- **Next:** [CommentedText.HighlightMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/commentedtext/highlightmode-property/llms-full.txt)
