kymaita

Hi

It is possible to get rid off the little window (counting the number of pages ) that appear each time we print using the PrintDocument control

I want to print without showing anything to the user

Any sug

thanks




Re: Windows Forms General get rid off the little window using printdocument

nobugz

That window is created by the PrintControllerWithStatusDialog class. That class is used by the PrintPreviewControl when it calculates the preview. I see no option to have it use a regular PrintController.





Re: Windows Forms General get rid off the little window using printdocument

Peter Ritchie

By default the PrintDocument class uses the PrintControllerWithStatusDialog class as the PrintController type if the PrintDocument.PrintController is not set when PrintDocument.Print is called. If you want to use a specific PrintController type during printing simply set the PrintDocument.PrintController when you initialize your PrintDocument object. If you don't want a status dialog while printing, you can use StandardPrintController:

printDocument1.PrintController = new System.Drawing.Printing.StandardPrintController();

You'll have to handle informing the user of status in your PrintPage event handler (or otherwise). Be warned, the parent dialog is hijacked while printing and isn't given a chance to update until printing is complete (which is less noticeable when PrintControllerWithStatusDialog is used).






Re: Windows Forms General get rid off the little window using printdocument

Doug N de Atlanta

Peter,

Could you please supply the code you used to suppress the status dialog.

I have tried setting the controller and the dialog still appears. I have scoured the posts and found that noone else has solved this issue either.

Thanks,





Re: Windows Forms General get rid off the little window using printdocument

Fred_028

Hi Peter,

I've tried using both the StandardPrintController and the PreviewPrintController and neither causes the status dalog to be suppressed.

In fact, after instantiating a new PrintDocument, I set its PrintController. But I find that in the OnBeginPrint override, the PreviewController member is back to the StandardPrintController.

What am I doing wrong

Thanks,

Fred