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

Get Visual Basic® .NET by Example now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.