TX Text Control .NET for Windows Forms

PageNumberFields Property

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

Description

Gets a collection of page number fields in the header or footer. The property's value is an object of the type PageNumberFieldCollection.

Syntax

public PageNumberFieldCollection PageNumberFields { get; }

Examples

The following example creates a “Page X of Y” header with current-page and page-count fields.

HeaderFooterCollection headers = textControl.Sections[1].HeadersAndFooters;
headers.Add(HeaderFooterType.Header);
HeaderFooter headerFooter = headers.GetItem(HeaderFooterType.Header);
headerFooter.Selection.Text = "Page ";
headerFooter.PageNumberFields.Add(new PageNumberField());
headerFooter.Selection.Text = " of ";
headerFooter.PageNumberFields.Add(new PageNumberField() { ShowNumberOfPages = true });

Limitations

Read only.

See Also

Text Fields and Hypertext Links - Inserting Page Numbers.