Cancel Printing the Silverlight Printing Dialog Box

Does anyone know if it is possible to find out if the cancel of the print dialog has been pressed?

I saw a message and a doc that say "EndPrint - Event fires when printing is complete or canceled."

But I don’t think this is canceling the print dialog ... I think that if the print job is canceled.

thanks

+6
printing silverlight
source share
2 answers

Based on the documentation, I don't think this is an easy way: http://msdn.microsoft.com/en-us/library/system.windows.printing.printdocument.endprint(v=VS.95).aspx

In particular:

The EndPrint event will not occur if the user cancels the print operation from the print dialog box. The BeginPrint event will always occur before the EndPrint event.

Apparently, the EndPrint event should be cleared only if the document was actually printed, and not if the print dialog was canceled. A.

+2
source share

There is one way if the "PrintPage" event is not raised after calling the printDocument.Print () method, which means that the Cancel button was clicked by the user in the print dialog box. A.

hope this helps.

0
source share

All Articles