System.Drawing.Printing.PrintController.OnEndPrint Method

When overridden in a derived class, completes the control sequence that determines when and how to print a document.


public virtual void OnEndPrint (PrintDocument document, PrintEventArgs e)


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


PrintController.OnEndPrint(PrintDocument, PrintEventArgs) is called immediately after the System.Drawing.Printing.PrintDocument raises the PrintDocument.EndPrint event.

PrintController.OnStartPrint(PrintDocument, PrintEventArgs) creates the System.Drawing.Graphics that is sent to the printer. After PrintController.OnStartPrint(PrintDocument, PrintEventArgs) is called, the PrintController.OnStartPage(PrintDocument, PrintPageEventArgs) method sets the System.Drawing.Graphics to a graphic of a single page. (Use the PrintController.OnStartPrint(PrintDocument, PrintEventArgs) method to determine when and how to print a document. For example, you can delay printing for 30 minutes or adjust the printer settings for the document.) The PrintController.OnEndPage(PrintDocument, PrintPageEventArgs) method clears the System.Drawing.Graphics, while the PrintController.OnEndPrint(PrintDocument, PrintEventArgs) method deallocates the object.


Namespace: System.Drawing.Printing
Assembly: System.Drawing (in System.Drawing.dll)
Assembly Versions: 1.0.5000.0,