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

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