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