PrintPreviewControl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • IB

    PrintPreviewControl

    ... 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 PrintPreviewDia log instead, my page appears fine (on
    the dialog).


    Any ideas?

    Thanks

  • Armin Zingler

    #2
    Re: PrintPreviewCon trol

    "IB" <ib@ib.comschri eb
    .. 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 PrintPreviewDia log instead, my
    page appears fine (on the dialog).

    Have you tried the example in the help?
    Represents the raw preview part of print previewing from a Windows Forms application, without any dialog boxes or buttons. Most PrintPreviewControl objects are found on PrintPreviewDialog objects, but they do not have to be.

    Does it work as you expect? Where's the difference to you code?


    Armin

    Comment

    • kimiraikkonen

      #3
      Re: PrintPreviewCon trol

      On Nov 14, 9:34 am, "IB" <i...@ib.comwro te:
      .. 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 PrintPreviewDia log 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:
      Represents the raw preview part of print previewing from a Windows Forms application, without any dialog boxes or buttons. Most PrintPreviewControl objects are found on PrintPreviewDialog objects, but they do not have to be.


      However, my suspicion is that whether you may have placed a
      PrintPreviewCon trol from designer on your form which has a GUI on
      designer, and then you may have created an extra PrintPreviewCon trol
      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

      Comment

      • IB

        #4
        Re: PrintPreviewCon trol


        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


        Comment

        Working...