TX Text Control .NET for Windows Forms

TableOfContents Constructor

Constructor|Introduced in 29.0
Namespace
TXTextControl
Package
TXTextControl.TextControl.WinForms.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

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 property dedines the level of a paragraph.

Syntax

public TableOfContents(short minimumStructureLevel, short maximumStructureLevel);

Parameters

ParameterDescription
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.

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