Print Preview Dialog doesn't close??

timh

Well-known member
Joined
Nov 28, 2008
Messages
50
Programming Experience
Beginner
I expect I'm missing something blindingly obvious here, but...

I am using a standard PrintPreviewDialog in my application (Visual Studio 2010) and everything works fine, except that when I click the print button, the document prints but the preview dialog stays open... Shouldn't it close once the document is printed? What am I doing wrong?
 
PrintPreviewDialog does not close when you click the print button. If you want that you could for example use the PrintDocument EndPrint event handler to check circumstances and manually Close the dialog. In event handler e.PrintAction will tell you if the print was to preview or printer. You can also check the dialogs Modal property to see if it is currently displayed.
 
Or you could just create a control inheriting the print preview control and override the button events method to add a close.

Sent using XT910 with Android 4.0.4 and MIUI 2.8.10
 
Back
Top