Files
docs-desktop/dotnet-desktop-guide/framework/winforms/controls/how-to-display-print-preview-in-windows-forms-applications.md
T
Andy De George c0ba284473 Initial winforms content migrated (#18)
* Merge winforms framework content to working branch (#14)

* Breadcrumb / TOC / Move net5 to net folder (#15)

* change path from net5 to net

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Mess with bread/toc

* Add .net 5 winforms placeholder article (#16)

* added some metadata and adjusted net5 placeholder

* corrections

* corrections

* corrections

* Test1

* Swapping landing page vs concept

* fix links

* Fix links

* Fix desc
2020-09-01 16:26:21 -07:00

4.5 KiB

title, titleSuffix, ms.date, dev_langs, helpviewer_keywords, ms.assetid
title titleSuffix ms.date dev_langs helpviewer_keywords ms.assetid
Display Print Preview in Windows Forms apps 03/30/2017
csharp
vb
cpp
print preview [Windows Forms], displaying
printing [Windows Forms], print preview
examples [Windows Forms], print preview
e394134c-0886-4517-bd8d-edc4a3749eb5

How to: Display Print Preview in Windows Forms Applications

You can use the xref:System.Windows.Forms.PrintPreviewDialog control to enable users to display a document, often before it is to be printed.

To do this, you need to specify an instance of the xref:System.Drawing.Printing.PrintDocument class; this is the document to be printed. For more information about using print preview with the xref:System.Drawing.Printing.PrintDocument component, see How to: Print in Windows Forms Using Print Preview.

Note

To use the xref:System.Windows.Forms.PrintPreviewDialog control at run time, users must have a printer installed on their computer, either locally or through a network, as this is partly how the xref:System.Windows.Forms.PrintPreviewDialog component determines how a document will look when printed.

The xref:System.Windows.Forms.PrintPreviewDialog control uses the xref:System.Drawing.Printing.PrinterSettings class. Additionally, the xref:System.Windows.Forms.PrintPreviewDialog control uses the xref:System.Drawing.Printing.PageSettings class, just as the xref:System.Windows.Forms.PrintPreviewDialog component does. The print document specified in the xref:System.Windows.Forms.PrintPreviewDialog control's xref:System.Windows.Forms.PrintPreviewControl.Document%2A property refers to instances of both the xref:System.Drawing.Printing.PrinterSettings and xref:System.Drawing.Printing.PageSettings classes, and these are used to render the document in the preview window.

To view pages using the PrintPreviewDialog control

See also