TX Text Control .NET for Windows Forms Documentation

Page Class

An object of the Page class represents a formatted page of a document. Pages are numbered from the beginning to the end of the document beginning with 1. A document has at least one page. Each section of a document can have one or more pages depending on the text that is contained in the section. A section does not have to begin at the top of a page. Therefore more than one section can be on one page. A page object can be obtained from the page collection available through the TextControl.GetPages method. This collection is only available, if the TextControl.ViewMode property has been set to PageView.

Introduced: 14.0.

Syntax

[C#] public class Page
[Visual Basic] Public Class Page

Properties

PropertyDescription
BoundsGets the bounding rectangle of the page, in twips, relative to the top of the document.
LengthGets the number of characters of the page, including the page break character at the end of the page.
NumberGets the page's number.
NumberInSectionGets the page number relative to the beginning of the section the page belongs to.
SectionGets the number, one-based, of the section the page belongs to.
StartGets the number (one-based) of the page's first character.
TextBoundsGets the bounding rectangle of the page's text, in twips, relative to the top of the document.

Methods

MethodDescription
GetImageGets an image of the page's contents.
SelectSelects the text of the page.

Example

The following example shows how to scroll to a specific page.

[C#] textControl1.ViewMode = TXTextControl.ViewMode.PageView; for (int i = 0; i < 100; i++) textControl1.Selection.Text = new string('a', 200); textControl1.ScrollLocation = new Point(textControl1.ScrollLocation.X, textControl1.GetPages()[2].Bounds.Top);
[Visual Basic] TextControl1.ViewMode = TXTextControl.ViewMode.PageView For i = 1 To 100 TextControl1.Selection.Text = New String("a", 200) i = i + 1 Next TextControl1.ScrollLocation = New Point(TextControl1.ScrollLocation.X, _ TextControl1.GetPages()(2).Bounds.Top)

See Also

 
 
 

Products

Support

Downloads

Corporate

Buy Now