PrintPreviewControl

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • gsb58@hotmail.com

    PrintPreviewControl

    Hi!

    I seem to be missing something when using the PrintPreviewDia log.

    On a form I have a monthCalendar which, at runtime, will display all
    months of the year. Now I have routine for printing the calendar and it
    works fine. However, when I try to bind this object to the
    PrintPreviewDia log, the dialog is blank.

    Can anybody guide me?

    I have: PrintDocument(p Doc1) and PrintPreviewDia log(ppDlg1) components.

    The code for the btnPreview is as follows:

    PrintDocument pDoc1 = new PrintDocument() ;
    PrintPreviewDia log ppDlg1 = new PrintPreviewDia log();
    ppDlg1.Document = pDoc1;
    ppDlg1.ShowDial og();

    Now I guess I'm missing how to bind the calendar to the pDoc1, right?

    I would be very happy if somebody can see the obvious mistake I'm
    doing! :-)

    Me.Name

  • Ciaran

    #2
    Re: PrintPreviewCon trol

    You need to handle the BeforePrint, PrintPage and EndPRint events of the
    PrintDocument. This will give you access to the graphics of the print
    document to draw things on. You then need to get the calender control to
    draw itself onto a page of the print document.

    You might want to read into Printing more

    Ciaran

    <gsb58@hotmail. com> wrote in message
    news:1137586694 .952352.63450@o 13g2000cwo.goog legroups.com...[color=blue]
    > Hi!
    >
    > I seem to be missing something when using the PrintPreviewDia log.
    >
    > On a form I have a monthCalendar which, at runtime, will display all
    > months of the year. Now I have routine for printing the calendar and it
    > works fine. However, when I try to bind this object to the
    > PrintPreviewDia log, the dialog is blank.
    >
    > Can anybody guide me?
    >
    > I have: PrintDocument(p Doc1) and PrintPreviewDia log(ppDlg1) components.
    >
    > The code for the btnPreview is as follows:
    >
    > PrintDocument pDoc1 = new PrintDocument() ;
    > PrintPreviewDia log ppDlg1 = new PrintPreviewDia log();
    > ppDlg1.Document = pDoc1;
    > ppDlg1.ShowDial og();
    >
    > Now I guess I'm missing how to bind the calendar to the pDoc1, right?
    >
    > I would be very happy if somebody can see the obvious mistake I'm
    > doing! :-)
    >
    > Me.Name
    >[/color]


    Comment

    • gsb58@hotmail.com

      #3
      Re: PrintPreviewCon trol

      Thanks, I'll do that! :-)
      Ciaran skrev:
      [color=blue]
      > You need to handle the BeforePrint, PrintPage and EndPRint events of the
      > PrintDocument. This will give you access to the graphics of the print
      > document to draw things on. You then need to get the calender control to
      > draw itself onto a page of the print document.
      >
      > You might want to read into Printing more
      >
      > Ciaran
      >
      > <gsb58@hotmail. com> wrote in message
      > news:1137586694 .952352.63450@o 13g2000cwo.goog legroups.com...[color=green]
      > > Hi!
      > >
      > > I seem to be missing something when using the PrintPreviewDia log.
      > >
      > > On a form I have a monthCalendar which, at runtime, will display all
      > > months of the year. Now I have routine for printing the calendar and it
      > > works fine. However, when I try to bind this object to the
      > > PrintPreviewDia log, the dialog is blank.
      > >
      > > Can anybody guide me?
      > >
      > > I have: PrintDocument(p Doc1) and PrintPreviewDia log(ppDlg1) components.
      > >
      > > The code for the btnPreview is as follows:
      > >
      > > PrintDocument pDoc1 = new PrintDocument() ;
      > > PrintPreviewDia log ppDlg1 = new PrintPreviewDia log();
      > > ppDlg1.Document = pDoc1;
      > > ppDlg1.ShowDial og();
      > >
      > > Now I guess I'm missing how to bind the calendar to the pDoc1, right?
      > >
      > > I would be very happy if somebody can see the obvious mistake I'm
      > > doing! :-)
      > >
      > > Me.Name
      > >[/color][/color]

      Comment

      Working...