It is not a property of a PrintDocument, it is a property of PrintPageEventArgs. An instance of which gets passed to your PrintPage event handler.
The way the PrintController and PrintDocument classes work is heavily affected by the way printing is implemented in Windows. A core implementation detail is that it is page-based. The printer driver deals with one page at a time, the underlying winapi function is StartPage(). Anything rendered to the print device context ends up on one page. Then the EndPage() winapi function completes the page and submits it to the spooler.
It might help to diagram the calls made while a 3 page document is printed:
StartDoc()
PrintDocument.BeginPrint event
StartPage()
PrintDocument.PrintPage event, e.HasMorePages = true
EndPage()
StartPage()
PrintDocument.PrintPage event, e.HasMorePages = true
EndPage()
StartPage()
PrintDocument.PrintPage event, e.HasMorePages = false
EndPage()
PrintDocument.EndPrint event
EndDoc()
It ought to be clear now, by assigning e.HasMorePage = true, you let the PrintController keep firing the PrintPage event. It is up to you to paginate your document and render the content of the correct page in your PrintPage event handler. You'll need the BeginPrint event to, say, set your internal page counter to 0.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…