Printing Multiple Pages
So far, the examples in this chapter have been focusing on printing a single page. This, however, is not the common case when it comes to printing. More often than not, an application generates printouts that consist of multiple pages. So how is this accomplished? The PrintPageEventArgs parameter that is sent to the PrintPage event handler contains a property called hasMorePages. This property contains a Boolean value indicating whether more pages need to be printed. Because only your code knows this, you need to set this property at the end of the PrintPage event handler. This value defaults to False, which explains why your examples have only printed one page so far.
So how do you know when there are more pages to print? ...
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.