How to remove 'Cancel' form during printing with PrintDocument

J Trahair

Well-known member
Joined
May 14, 2008
Messages
175
Location
Spain
Programming Experience
10+
When a print run is in progress, I get a repeated pop-up forms saying Page x of document, with a Cancel button. How can I hide these? Thank you.
 
This is a behaviour of the print controller, default is PrintControllerWithStatus. You can assign an instance of StandardPrintController to PrintController property instead for it to not display status.
 
Great, thank you.

VB.NET:
            'The standard print controller comes with no UI
            Dim standardPrintController As New System.Drawing.Printing.StandardPrintController
            'Print the report using the custom print controller
            objPrintDoc1.PrintController = standardPrintController

did it.
 
Unless you need a variable to simplify referring to same object multiple times you should not declare one.
objPrintDoc1.PrintController = New Printing.StandardPrintController
 
Back
Top