# TableOfContents.HighlightMode Property

> Gets or sets a value indicating how the text of the table of contents is highlighted.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 29.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WPF.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 WPF > Reference > TXTextControl > TableOfContents.HighlightMode Property
- **583 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontents/highlightmode-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontents/highlightmode-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontents/highlightmode-property/llms-full.txt

---

### Description

Gets or sets a value indicating how the text of the table of contents is highlighted.

### Syntax

```csharp
public HighlightMode HighlightMode { get; set; }
```

```vbnet
Public Property HighlightMode As HighlightMode
```

### Members

| Value | Description |
|---|---|
| Auto | This value is not used for tables of contents. |
| Activated | The table of contents is only highlighted, when it contains the current text input position and when the control has the input focus. |
| Always | The table of contents is always highlighted. |
| Never | The table of contents is never highlighted. |

### Examples

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

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

tableOfContents.HighlightMode = HighlightMode.Never;
Console.WriteLine($"Highlight Mode used by Table Of Contents: {tableOfContents.HighlightMode}");
```

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

tableOfContents.HighlightMode = HighlightMode.Never
Console.WriteLine($"Highlight Mode used by Table Of Contents: {tableOfContents.HighlightMode}")
```

---

## Nearby

- **Previous:** [TableOfContents.HighlightColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontents/highlightcolor-property/llms-full.txt)
- **Next:** [TableOfContents.ID Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontents/id-property/llms-full.txt)
