PrintPreviewDialog

  • Thread starter Thread starter gabriel
  • Start date Start date
G

gabriel

Hi all,

I've got a problem with a PrintPreviewDialog. It shows my document correctly
but when I try to print I only get the last page. Now when I use the print
function of my document directly it print's correctly. I've overriden the
OnPrintPage function of PrintDocument and for as far as I can see I've
correctly set he HasMorePages property.

Does anyone have an idea on how to fix this, or what I'm forgetting.

Thanks on advance,
Gabriel
 
Gabriel,
You need to have something that resets the position of your data stream
when you start printing. You can override OnBeginPrint for this (and other
things). When you press the Print button on the PrintPreviewDialog the
Print method for your document is called again with the printer's graphics
as destination.

Ron Allen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top