The PageNumberField class represents a field in a header or footer of a Text Control document that automatically displays the current page number. The class inherits all properties and methods from the TextField class. Additionally it implements the properties in the following list. For more information see the technical article Text Fields and Hypertext Links.

Syntax

public class PageNumberField : TextField
Public Class PageNumberField
  Inherits TextField

Examples

The following example shows how to add a page number field to a header.

textControl1.ViewMode = TXTextControl.ViewMode.PageView;

textControl1.Sections.GetItem().HeadersAndFooters.Add(
    TXTextControl.HeaderFooterType.Header);
TXTextControl.HeaderFooter header = 
    textControl1.Sections.GetItem().HeadersAndFooters.GetItem(
    TXTextControl.HeaderFooterType.Header);

header.Selection.Text = "Page ";
header.PageNumberFields.Add(new TXTextControl.PageNumberField(
    1, TXTextControl.NumberFormat.ArabicNumbers));
TextControl1.ViewMode = TXTextControl.ViewMode.PageView

TextControl1.Sections.GetItem().HeadersAndFooters.Add( _
    TXTextControl.HeaderFooterType.Header)
Dim Header As TXTextControl.HeaderFooter = _
    TextControl1.Sections.GetItem().HeadersAndFooters.GetItem( _
    TXTextControl.HeaderFooterType.Header)

Header.Selection.Text = "Page "
Header.PageNumberFields.Add(New TXTextControl.PageNumberField( _
    1, TXTextControl.NumberFormat.ArabicNumbers))

Constructors

Constructor Description
PageNumberField Creates a new instance of the PageNumberField class.

Methods

Method Description
PageNumberDialog Opens a dialog box to alter the formatting and numbering attributes of the page number field.

Properties

Property Description
NumberFormat Gets or sets the number format.
ShowNumberOfPages Gets or sets a value indicating whether the field shows the page number or the total number of pages.
StartNumber Gets or sets the page number for the first page.