Printing a Form

When adding print support to an application or form, the basic idea is to utilize a System.Drawing.Printing.PrintDocument object and respond to its events. In responding to those events, you are able to write your specific code to print your form. Table 27.1 lists the specific events generated by instances of the PrintDocument class.

Table 27.1. PrintDocument Events
Event Name Description
BeginPrint This event is generated at the start of the printing process.
EndPrint This event is generated at the end of the printing process.
PrintPage This event is generated for each page that needs to be printed.
QueryPrinterSettings This event is generated just before each PrintPage event. The reason is because the printer settings could change ...

Get Visual Basic® .NET by Example 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.