Share via


Printer.Page Property

Returns the page number of the page that is currently being printed.

Namespace:  Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

Syntax

'Declaration
Public ReadOnly Property Page As Short
public short Page { get; }
public:
property short Page {
    short get ();
}
member Page : int16 with get
function get Page () : short

Property Value

Type: System.Int16
Returns a Short.

Remarks

Visual Basic keeps a count of pages that have been printed since your application started or since the last time the EndDoc method was called on the Printer object. This count starts at one and increases by one if:

  • You call the NewPage method.

  • You call the Print method and the text you want to print does not fit on the current page.

    Note

    If the output of a graphics method does not fit on the page, a new page is not generated. The output is clipped to fit the page's printable area.

Note

Functions and objects in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 namespace are provided for use by the tools for upgrading from Visual Basic 6.0 to Visual Basic. In most cases, these functions and objects duplicate functionality that you can find in other namespaces in the .NET Framework. They are necessary only when the Visual Basic 6.0 code model differs significantly from the .NET Framework implementation.

Examples

The following example demonstrates how to retrieve the Page property value.

Dim Printer As New Printer
Printer.Print("This is page " & CStr(Printer.Page))
Printer.NewPage()
Printer.Print("This is page " & CStr(Printer.Page))
Printer.EndDoc()

.NET Framework Security

See Also

Reference

Printer Class

Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace

Other Resources

Printer Compatibility Library

How to: Fix Upgrade Errors by Using the Printer Compatibility Library (Visual Basic)

Deploying Applications That Reference the Printer Compatibility Library