Name

PrintPreviewControl

Synopsis

This Control provides standardized print preview facilities to your application. It includes only the body of the print preview, rather than all the buttons and other facilities. For standard print preview you should use the PrintPreviewDialog, but if you have specific, custom requirements, you can embed this object instead and provide your own supporting UI.

To use the control, you should provide a Document to be previewed. You can then decide how many Columns and Rows of pages will be displayed and whether to AutoZoom to fit (if not, you can specify your own Zoom factor). You can also enable or disable high-quality antialiasing with the UseAntiAlias property.


public class PrintPreviewControl : Control {

// Public Constructors

   public PrintPreviewControl();

// Public Instance Properties

   public bool AutoZoom{set; get; }

   public int Columns{set; get; }

   public PrintDocument Document{set; get; }

   public int Rows{set; get; }

   public int StartPage{set; get; }

   public override string Text{set; get; }

// overrides Control

   public bool UseAntiAlias{set; get; }

   public double Zoom{set; get; }

// Protected Instance Properties

   protected override CreateParams CreateParams{get; }

// overrides Control

                  // Public Instance Methods

   public void InvalidatePreview();

   public override void ResetBackColor();  // overrides Control

   public override void ResetForeColor();  // overrides Control

                  // Protected Instance Methods

   protected override void OnPaint(PaintEventArgs pevent);  // overrides ...

Get .NET Windows Forms in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.