TX Text Control .NET for Windows Forms

Add Method

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

Description

Adds a new footnote to the document at the current text input position. A footnote consists of a reference mark in the document and the footnote itself appearing at the bottom of the page.

Syntax

public bool Add(Footnote footnote, bool edit);

Parameters

ParameterDescription
footnote

Specifies the footnote to add.

edit

If this parameter is true, the text input position is set in the footnote section at the bottom of the page, so that the footnote's text can be edited.

Return Value

The return value is true if the new footnote has successfully been inserted. Otherwise, it is false. Footnotes cannot be inserted in headers, footers and textframes.

Examples

The following example works with footnotes in the current document by using FootnoteCollection.Add.

textControl.Text = "Customer: Contoso Ltd.";
textControl.Select(10, 12);
FootnoteCollection footnoteCollection = textControl.Footnotes;

if (!footnoteCollection.Add(new Footnote("Quarterly results"), true))
{
    throw new InvalidOperationException("The item could not be inserted.");
}