This message contains graphics. If you do not see the graphics: Graphic Version.
 
Inserting continuous page numbers

TX Text Control .NET for Windows Forms has a special marked text field - the page number field. It is inserted into a header or a footer and automatically displays the current page number on every page. Additionally, you could insert a field which displays the total number of pages like "Page X of Y".

TX Text Control .NET for Windows Forms provides the PageNumberField, which can be initialized with a starting page number and the format of the numbering. Possible values are:

ArabicNumbers, Letters, CapitalLetters, RomanNumbers and SmallRomanNumbers.

The field will be constructed like this:

Dim pageField As New TXTextControl.PageNumberField(1, _ TXTextControl.NumberFormat.ArabicNumbers)

Finally, we insert a header and add the special field to it.

TextControl1.HeadersAndFooters.Add(TXTextControl.HeaderFooterType.Header) With TextControl1.HeadersAndFooters.GetItem(TXTextControl.HeaderFooterType.Header) .Selection.Text = "Page of " .Selection.Start = 5 .PageNumberFields.Add(pageField) .Selection.Start = 9 .TextFields.Add(curPages) End With

The curPages field is a normal TextField of TX Text Control, which will be updated with the total number of pages in the Changed event. The Pages property of TX Text Control .NET for Windows Forms returns the required value.

curPages.Text = TextControl1.Pages

The minimum requirements for this sample application are TX Text Control .NET for Windows Forms trial version and Visual Studio .NET 2003.


Best regards

The Newsletter Team

Text Control GmbH respects your online time and privacy. We only send this newsletter to TX Text Control customers and people who have signed up to receive it. However, if you would prefer not to receive future issues of the newsletter, you may unsubscribe at any time. If you received this newsletter forwarded from a colleague or friend, you may wish to subscribe directly.

Sent to: N/A.

Imprint | Unsubscribe | Subscribe

© 2004 Text Control GmbH. All Rights Reserved.