O'Reilly logo

Visual Basic® .NET by Example by Bob Donald, Gabriel Oancea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required