Dela via


Windows Forms Print Support

Printing in Windows Forms consists primarily of using the PrintDocument Component (Windows Forms) component to enable the user to print, and the PrintPreviewDialog Control (Windows Forms) control, PrintDialog Component (Windows Forms) and PageSetupDialog Component (Windows Forms) components to provide a familiar graphical interface to users accustomed to the Windows operating system.

Typically, you create a new instance of the PrintDocument component, set the properties that describe what to print using the PrinterSettings and PageSettings classes, and call the Print method to actually print the document.

During the course of printing from a Windows-based application, the PrintDocument component will show an abort print dialog box to alert users to the fact that printing is occurring and to allow the print job to be canceled.

In This Section