PrintPreviewControl

  • Thread starter Thread starter IB
  • Start date Start date
I

IB

... Can't get it to work. Whatever I do, I just get "document does not
contain any pages". I am setting the document property to a valid document
and if I just use the PrintPreviewDialog instead, my page appears fine (on
the dialog).


Any ideas?

Thanks
 
.. Can't get it to work. Whatever I do, I just get "document does not
contain any pages". I am setting the document property to a valid document
and if I just use the PrintPreviewDialog instead, my page appears fine (on
the dialog).

Any ideas?

Thanks

Hi,
Example on MSDN is worth to look and works fine on VS 2008 SP1 on
Vista:
http://msdn.microsoft.com/en-us/library/system.windows.forms.printpreviewcontrol.aspx

However, my suspicion is that whether you may have placed a
PrintPreviewControl from designer on your form which has a GUI on
designer, and then you may have created an extra PrintPreviewControl
dynamically(at runtime) like in the link above, therefore you're
seeing the one above which you have created in designer, though other
one(the one that you may have created at runtime) is still present in
background.

That's just my scenario.

Hope this helps,

Onur Güzel
 
Many thanks for the responses. I solved it in the end, I added a print
document and a print preview control at design time, but was setting the
print preview control document property at run time, and it seems this
doesn't work, although I don't know why. But setting the document property
at design time makes it work.

Cheers, Ian
 
Back
Top