views:

273

answers:

1

When printing in Windows forms, or doing a print preview, a dialog is displayed with text like

Page [P] of [DOC]

where [P] is page number and [DOC] is the name of the document. The dialog also contains a button to allow the user to cancel the print job.

How can I change the text displayed? What I would prefer is text like

Page [P] of [Pages]

where [Pages] is the total number of pages, to give the user an indication how long it will take to print all pages. If possible I would also like to show a progress bar, because when a print job is started, I know exactly how many pages will be printed.

+1  A: 

I did this:

  • Derive your own class from PrintDocument, handling all printing
  • Set the print controller to a new StandardPrintController (no dialog displayed then)
  • Display your own dialog, e.g. display and close in OnBeginPrint and OnEndPrint, update in OnPrintPage

If I remember correctly, there was no way to change the text, and since the default dialog is not localizable, we could not use it. It works fine with what I wrote above though.

OregonGhost