# TableOfContents.HighlightColor Property

> Gets or sets the highlight color for the table of contents. Depending on the HighlightMode a table of contents is highlighted, if it contains the current text input position, is always highlighted or never. The color's alpha value must be less than 255 (opaque) so that the text remains visible. The default value is black with an alpha value of 60.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 29.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 > TableOfContents.HighlightColor Property
- **551 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/highlightcolor-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/highlightcolor-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/highlightcolor-property/llms-full.txt

---

### Description

Gets or sets the highlight color for the table of contents. Depending on the [HighlightMode](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/highlightmode-property/llms-full.txt) a table of contents is highlighted, if it contains the current text input position, is always highlighted or never. The color's alpha value must be less than 255 (opaque) so that the text remains visible. The default value is black with an alpha value of 60.

### Syntax

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

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

### Examples

The following example creates a table of contents for the document's heading styles by using `TableOfContents.HighlightColor`.

```csharp
TableOfContents tableOfContents = new(1, 3) { Name = "Contents", ID = 10 };
textControl.TablesOfContents.Add(tableOfContents);

tableOfContents.HighlightColor = System.Drawing.Color.LightSteelBlue;
Console.WriteLine($"Highlight Color used by Table Of Contents: {tableOfContents.HighlightColor}");
```

```vbnet
Dim tableOfContents As New TableOfContents(1, 3) With { .Name = "Contents", .ID = 10 }
textControl.TablesOfContents.Add(tableOfContents)

tableOfContents.HighlightColor = System.Drawing.Color.LightSteelBlue
Console.WriteLine($"Highlight Color used by Table Of Contents: {tableOfContents.HighlightColor}")
```

---

## Nearby

- **Previous:** [TableOfContents.HasRightAlignedPageNumbers Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/hasrightalignedpagenumbers-property/llms-full.txt)
- **Next:** [TableOfContents.HighlightMode Property](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/tableofcontents/highlightmode-property/llms-full.txt)
