furjaw

Using the PrintPreviewDialog(),
I want to execute a command if the document was actually printed.
And not execute the command if printing was cancelled.
Is this possible

Private Sub btnPreview_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles btnPreview.Click

Dim dlg As New PrintPreviewDialog()
dlg.Document = mDoc
dlg.WindowState = FormWindowState.Maximized
dlg.ShowDialog()

End Sub



Re: Visual Basic Express Edition Using PrintPreviewDialog(), how can I tell if it was printed or cancelled?

ahmedilyas

you could implement the EndPrint event of the Document property...this will raise the event for when the last page has been printed - it is one way of knowing if the document has been printed.

http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.endprint.aspx