# TableOfContents Constructor

> Initializes a new instance of the TableOfContents class.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Constructor
- **Introduced:** 29.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.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 Server > Reference > TXTextControl > TableOfContents Constructor
- **558 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/constructor/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/constructor/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/constructor/llms-full.txt

---

### Description

Initializes a new instance of the TableOfContents class.

Defines a table of contents with the specified minimum and maximum structure level. All paragraphs that have a level between these borders will be contained in the table of contents. The [ParagraphFormat.StructureLevel](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/paragraphformat/structurelevel-property/llms-full.txt) property dedines the level of a paragraph.

### Syntax

```csharp
public TableOfContents(short minimumStructureLevel, short maximumStructureLevel);
```

```vbnet
Public Sub New(minimumStructureLevel As Short, maximumStructureLevel As Short)
```

### Parameters

| Parameter | Description |
|---|---|
| minimumStructureLevel | Specifies the minimum structure level of the paragraphs that will be contained in the table of contents. This value must be between 1 and 10. |
| maximumStructureLevel | Specifies the maximum structure level of the paragraphs that will be contained in the table of contents. This value must be between 1 and 10. |

### Examples

The following example creates a table of contents for the document's heading styles.

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

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

---

## Nearby

- **Previous:** [TableOfContents Class](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/llms-full.txt)
- **Next:** [TableOfContents.DefaultHighlightColor Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/tableofcontents/defaulthighlightcolor-property/llms-full.txt)
