TX Text Control .NET for Windows Forms Documentation

PageNumberField Class

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

[C#] public class PageNumberField : TextField
[Visual Basic] Public Class PageNumberField Inherits TextField

Constructors

ConstructorDescription
PageNumberFieldInitializes a new instance of the PageNumberField class.

Properties

PropertyDescription
NumberFormatGets or sets the number format.
StartNumberGets or sets the page number for the first page.

Example

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

[C#] 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));
[Visual Basic] 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))

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now