# TableOfContentsEventArgs Class

> The TableOfContentsEventArgs class provides data for the TableOfContentsCreated, TableOfContentsDeleted, TableOfContentsEntered and TableOfContentsLeft events. When a table of contents is deleted, the TableOfContents object provided with the event data has the following valid properties: HighlightColor, HighlightMode, ID, Name, MinimumStructureLevel, MaximumStructureLevel, HasLinks, HasPageNumbers and HasRightAlignedPageNumbers. All other properties are undefined.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Class
- **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
- **Inherits:** `System.EventArgs`
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl > TableOfContentsEventArgs Class
- **577 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontentseventargs/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontentseventargs/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontentseventargs/llms-full.txt

---

### Description

The TableOfContentsEventArgs class provides data for the [TableOfContentsCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentscreated-event/llms-full.txt), [TableOfContentsDeleted](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsdeleted-event/llms-full.txt), [TableOfContentsEntered](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsentered-event/llms-full.txt) and [TableOfContentsLeft](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsleft-event/llms-full.txt) events. When a table of contents is deleted, the [TableOfContents](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontents/llms-full.txt) object provided with the event data has the following valid properties: HighlightColor, HighlightMode, ID, Name, MinimumStructureLevel, MaximumStructureLevel, HasLinks, HasPageNumbers and HasRightAlignedPageNumbers. All other properties are undefined.

### Syntax

```csharp
public class TableOfContentsEventArgs : EventArgs
```

```vbnet
Public Class TableOfContentsEventArgs
    Inherits EventArgs
```

### Examples

The following example uses `TableOfContentsEventArgs.TableOfContents` while handling `TableOfContentsCreated`.

```csharp
textControl.TableOfContentsCreated += (_, e) =>
{
    e.TableOfContents?.ScrollTo();
};
```

```vbnet
AddHandler textControl.TableOfContentsCreated,
    Sub(sender, e)
        If e.TableOfContents IsNot Nothing Then e.TableOfContents.ScrollTo()
    End Sub
```

---

## In This Section

- [TableOfContentsEventArgs.TableOfContents Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontentseventargs/tableofcontents-property/llms-full.txt): Gets an object that represents the table of contents which causes the event. It is of the type TableOfContents.

---

## Nearby

- **Previous:** [TableOfContentsCollection.SyncRoot Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontentscollection/syncroot-property/llms-full.txt)
- **Next:** [TableOfContentsEventArgs.TableOfContents Property](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/tableofcontentseventargs/tableofcontents-property/llms-full.txt)
