System.Drawing.Printing.PrintController Class

Controls how a document is printed, when printing from a Windows Forms application.

See Also: PrintController Members


public abstract class PrintController


When implemented in a derived class, System.Drawing.Printing.PrintController controls how a System.Drawing.Printing.PrintDocument is printed. PrintDocument.Print invokes the print controller's PrintController.OnStartPrint(PrintDocument, PrintEventArgs), PrintController.OnEndPrint(PrintDocument, PrintEventArgs), PrintController.OnStartPage(PrintDocument, PrintPageEventArgs), and PrintController.OnEndPage(PrintDocument, PrintPageEventArgs) methods, which in turn tell the printer how to print the document. Print preview uses a specialized System.Drawing.Printing.PrintController. For an example of a print controller that is specialized for print preview, see the System.Drawing.Printing.PreviewPrintController.

System.Drawing.Printing.PrintController is used by System.Drawing.Printing.PrintDocument, and not typically used directly.

The .NET Framework includes three print controllers that are derived from System.Drawing.Printing.PrintController that help accomplish common tasks. The System.Drawing.Printing.StandardPrintController prints a document to a printer. The System.Drawing.Printing.PreviewPrintController generates a preview of what the document will look like when printed and is used by the System.Windows.Forms.PrintPreviewControl and System.Windows.Forms.PrintPreviewDialog classes. The System.Windows.Forms.PrintControllerWithStatusDialog provides a printing status dialog during the printing process.

For more information about printing with Windows Forms, see the System.Drawing.Printing namespace overview. If you wish to print from a Windows Presentation Foundation application, see the System.Printing namespace.


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