PageCount Property (Form)
Returns the number of pages in the form after the form is paginated.
public int PageCount {
get
}
Remarks
The Form control exposes the PageCount property and the CurrentPage property, which provide information about how the current form is paginated. The PageCount property also helps provide navigation capability to another page. For example, when rendering on a richer device, a search results form might include device-specific UI elements that allow the user to browse to a page of results by number rather than by link navigation.
Note This value is available after the Paginated event has occurred. To get the PageCount property, you can handle the Paginated event of the form.
Example
The following example demonstrates how to use the PageCount property of the Form control.
Public Sub Form_Paginated(sender As Object, e As EventArgs)
Label1.Text = "This is Page no." & myForm.CurrentPage.ToString() & _ "
of " & myForm.PageCount.ToString() + " total Pages. "
End Sub
[C#]
void Form_Paginated(object sender, EventArgs e)
{
Label1.Text = "This is Page no. " + myForm.CurrentPage +
" of " + myForm.PageCount + " total Pages.";
}
See Also
Applies to: Form Class