Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WinForms. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
Description
Adds a new table of contents to the document at the current text input position.
Syntax
public TableOfContentsCollection.AddResult Add(TableOfContents tableOfContent);Public Function Add(tableOfContent As TableOfContents) As TableOfContentsCollection.AddResultParameters
| Parameter | Description |
|---|---|
| tableOfContent | Specifies the table of contents to add. |
Return Value
The return value specifies whether the new table of contents has successfully been inserted. It can be one of the TableOfContentsCollection.AddResult values.
Examples
The following example works with tables of contents in the current document by using TableOfContentsCollection.Add.
textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
TableOfContentsCollection tableOfContentsCollection = textControl.TablesOfContents;
var result = tableOfContentsCollection.Add(new TableOfContents(10, 10));
Console.WriteLine($"Add result: {result}");textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim tableOfContentsCollection As TableOfContentsCollection = textControl.TablesOfContents
Dim result = tableOfContentsCollection.Add(New TableOfContents(10, 10))
Console.WriteLine($"Add result: {result}")