System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPage Method

Begins the control sequence that determines when and how to print a page of a document.

Syntax

public override System.Drawing.Graphics OnStartPage (System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintPageEventArgs e)

Parameters

document
A System.Drawing.Printing.PrintDocument that represents the document currently being printed.
e
A System.Drawing.Printing.PrintPageEventArgs that contains the event data.

Returns

A System.Drawing.Graphics object that represents a page from a System.Drawing.Printing.PrintDocument.

Remarks

The System.Windows.Forms.PrintControllerWithStatusDialog class calls the System.Drawing.Printing.PrintController.OnStartPage(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintPageEventArgs) method on the encapsulated System.Drawing.Printing.PrintController.

The PrintControllerWithStatusDialog.OnStartPage(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintPageEventArgs) method is called immediately before the System.Drawing.Printing.PrintDocument raises the System.Drawing.Printing.PrintDocument.PrintPage event.

The PrintControllerWithStatusDialog.OnStartPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) method creates the System.Drawing.Graphics object that is sent to the printer. After PrintControllerWithStatusDialog.OnStartPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) is called, PrintControllerWithStatusDialog.OnStartPage(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintPageEventArgs) sets the System.Drawing.Graphics object to a graphic of a single page. The PrintControllerWithStatusDialog.OnEndPage(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintPageEventArgs) method clears the System.Drawing.Graphics object, while the PrintControllerWithStatusDialog.OnEndPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) method deallocates the object.

Use PrintControllerWithStatusDialog.OnStartPage(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintPageEventArgs) to set how to print a page in a document. For example, you can adjust page settings separately for each page.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0