How can I prevent from the user to print from PrintPreviewDialog

yulyos

Well-known member
Joined
Jun 4, 2004
Messages
67
Location
Israel
Programming Experience
5-10
Hi,

How can I prevent from the user to print from PrintPreviewDialog

I am using the code below:
VB.NET:
        Dim PPD As New PrintPreviewDialog
        PPD.WindowState = FormWindowState.Maximized
        PPD.Document = PrintDocument1
        PPD.ShowDialog()
When the PrintPreviewDialog show the Document, the user can print the Document.

How can I prevent from the user to print from PrintPreviewDialog?
 
Why do you want to do this? If you only want them to be able to preview the document, use the PrintPreviewControl instead of the PrintPreviewDialog.
 
This should work.

VB.NET:
            CType(PPD.Controls(1), ToolStrip).Items(0).Enabled = False
            PPD.ShowDialog()
 
Back
Top