TX Text Control .NET for WPF

Add Method

Method
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK as TXTextControl.dll from the private NuGet feed or Text Control Offline Packages

Description

Inserts a new page number field at the current input position of a header or footer.

Syntax

public bool Add(PageNumberField pageNumberField);

Parameters

ParameterDescription
pageNumberField

Specifies the page number field to add.

Return Value

The return value is true, if the page number field could be added. Otherwise it is false.

Examples

The following example builds a “Page X of Y” footer with two page-number fields.

textControl.HeadersAndFooters.Add(HeaderFooterType.Footer);
HeaderFooter footer = textControl.HeadersAndFooters.GetItem(HeaderFooterType.Footer);
PageNumberFieldCollection fields = footer.PageNumberFields;
footer.Selection.Text = "Page ";
fields.Add(new PageNumberField());
footer.Selection.Text = " of ";
fields.Add(new PageNumberField() { ShowNumberOfPages = true });