System.Drawing.Printing.PreviewPrintController Class

Specifies a print controller that displays a document on a screen as a series of images.

See Also: PreviewPrintController Members

Syntax

public class PreviewPrintController : PrintController

Remarks

Typically, to use the print preview feature, you create an instance of a System.Windows.Forms.PrintPreviewControl or System.Windows.Forms.PrintPreviewDialog class and set its System.Windows.Forms.PrintPreviewControl.Document property. The System.Drawing.Printing.PreviewPrintController is used by the System.Windows.Forms.PrintPreviewControl and System.Windows.Forms.PrintPreviewDialog classes, though you can use the System.Drawing.Printing.PreviewPrintController when managing the display of your own print preview window.

PreviewPrintController.OnStartPrint(PrintDocument, PrintEventArgs) creates the System.Drawing.Graphics that is displayed during the print preview. After PreviewPrintController.OnStartPrint(PrintDocument, PrintEventArgs) is called, the PreviewPrintController.OnStartPage(PrintDocument, PrintPageEventArgs) method sets the System.Drawing.Graphics to a graphic of a single page. The PreviewPrintController.OnEndPage(PrintDocument, PrintPageEventArgs) method clears the System.Drawing.Graphics, while the PreviewPrintController.OnEndPrint(PrintDocument, PrintEventArgs) method deallocates the object.

For more information about printing, see the System.Drawing.Printing namespace overview.

Requirements

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