# TextControl.TableOfContentsDialog Method

> Invokes the built-in dialog box for inserting or changing a table of contents. If the current text input position is in an existing table of contents, the dialog box shows its attributes and the user can change it. Otherwise, a new table of contents is inserted with the specified attributes.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.TableOfContentsDialog Method
- **337 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsdialog-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsdialog-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsdialog-method/llms-full.txt

---

### Description

Invokes the built-in dialog box for inserting or changing a table of contents. If the current text input position is in an existing table of contents, the dialog box shows its attributes and the user can change it. Otherwise, a new table of contents is inserted with the specified attributes.

### Syntax

```csharp
public DialogResult TableOfContentsDialog();
```

```vbnet
Public Function TableOfContentsDialog() As DialogResult
```

### Return Value

If the dialog has been left with the Cancel button the return value is DialogResult.Cancel. Otherwise, it is DialogResult.OK.

### Examples

The following example opens the table of contents dialog for the text control.

```csharp
var result = textControl.TableOfContentsDialog();
Console.WriteLine($"Table Of Contents Dialog result: {result}");
```

```vbnet
Dim result = textControl.TableOfContentsDialog()
Console.WriteLine($"Table Of Contents Dialog result: {result}")
```

---

## Nearby

- **Previous:** [TextControl.TableOfContentsDeleted Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsdeleted-event/llms-full.txt)
- **Next:** [TextControl.TableOfContentsEntered Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsentered-event/llms-full.txt)
