Add Method
- Namespace
TXTextControl
- Package
TXTextControl.asTextControl. WPF. SDK TXTextControl.from the private NuGet feed or Text Control Offline Packagesdll
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);Public Function Add(footnote As Footnote, edit As Boolean) As BooleanParameters
| Parameter | Description |
|---|---|
| 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.");
}textControl.Text = "Customer: Contoso Ltd."
textControl.Select(10, 12)
Dim footnoteCollection As FootnoteCollection = textControl.Footnotes
If Not footnoteCollection.Add(New Footnote("Quarterly results"), True) Then
Throw New InvalidOperationException("The item could not be inserted.")
End If