PrintPreviewControl

  • Thread starter Thread starter gsb58
  • Start date Start date
G

gsb58

Hi!

I seem to be missing something when using the PrintPreviewDialog.

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
PrintPreviewDialog, the dialog is blank.

Can anybody guide me?

I have: PrintDocument(pDoc1) and PrintPreviewDialog(ppDlg1) components.

The code for the btnPreview is as follows:

PrintDocument pDoc1 = new PrintDocument();
PrintPreviewDialog ppDlg1 = new PrintPreviewDialog();
ppDlg1.Document = pDoc1;
ppDlg1.ShowDialog();

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
 
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
 
Thanks, I'll do that! :-)
Ciaran skrev:
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
 

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