- document
- A System.Drawing.Printing.PrintDocument that represents the document currently being printed.
- e
- A System.Drawing.Printing.PrintEventArgs that contains the event data.
The System.Windows.Forms.PrintControllerWithStatusDialog class calls the System.Drawing.Printing.PrintController.OnStartPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) method on the encapsulated System.Drawing.Printing.PrintController.
The PrintControllerWithStatusDialog.OnStartPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) method is called immediately after the System.Drawing.Printing.PrintDocument raises the System.Drawing.Printing.PrintDocument.BeginPrint event.
Use PrintControllerWithStatusDialog.OnStartPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) 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. PrintControllerWithStatusDialog.OnStartPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) 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, the PrintControllerWithStatusDialog.OnStartPage(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintPageEventArgs) method 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.
PrintControllerWithStatusDialog.OnStartPrint(System.Drawing.Printing.PrintDocument, System.Drawing.Printing.PrintEventArgs) is a good place to verify that System.Drawing.Printing.PrinterSettings are valid.