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

PrintPage Event and PrintPageEventArgs

In the previous example, the PrintPage event handler does not really do anything interesting. It just prints a text string and a rectangle on a single printed page. You need to look at the arguments passed to the PrintPage event handler to do anything useful, specifically, the PrintPageEventArgs argument. This argument contains all the necessary information that is essential for printing a page. For example, you need a Graphics object to draw on. You need page boundaries (including margins) so that you know the area you can draw in. You also need a way to print multiple pages as well as a way to cancel the printing process. This is essentially what the PrintPageEventArgs parameter provides for you, as the ...

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