Windows Forms Print Support
Visual Studio .NET 2003
Printing in Windows Forms consists primarily of using the PrintDocument component to enable the user to print, and the PrintPreviewDialog control, PrintDialog and PageSetupDialog 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 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
- Creating Standard Windows Forms Print Jobs
- Explains how to use the PrintDocument component to print from a Windows Form.
- Changing Windows Forms Print Options at Run Time
- Explains how to modify selected print options programmatically using the PrintDialog component.
- Choosing the Printers Attached to a User's Machine in Windows Forms
- Describes changing the printer to print to using the PrintDialog component at run time.
- Printing Graphics in Windows Forms
- Describes sending graphics to the printer.
- Printing Text in Windows Forms
- Describes sending text to the printer.
- Completing Windows Forms Print Jobs
- Explains how to alert users to the completion of a print job.
- Displaying Print Preview in Windows Applications
- Describes showing users the PrintPreviewDialog control.
Related Sections
- Code: Printing a Windows Form (Visual Basic)
- Shows example code that prints a copy of the current form.
- PrintDocument Component
- Explains usage of the PrintDocument component.
- PrintDialog Component
- Explains usage of the PrintDialog component.
- PrintPreviewDialog Control
- Explains usage of the PrintPreviewDialog control.
- PageSetupDialog Component
- Explains usage of the PageSetupDialog component.
- System.Drawing.Printing Namespace
- Describes the classes in the System.Drawing.Printing namespace.
- Windows Forms
- Gives an overview of working with Windows Forms.