当我在使用C#编写的
Windows应用程序中使用MyPrintDocument.print()时,会显示一个对话框,该对话框显示Windows处理打印程序并使用取消按钮.我不想这个对话框显示,是可能吗?
如果没有,我应该使用哪种方式?我的程序使用热敏打印机.
解决方法
你使用哪个
PrintController?
The .NET Framework includes three print controllers that are derived from
PrintController
that help accomplish common tasks. TheStandardPrintController
prints a document to a printer. ThePreviewPrintController
generates a preview of what the document will look like when printed and is used by thePrintPreviewControl
andPrintPreviewDialog
classes. ThePrintControllerWithStatusDialog
provides a printing status dialog during the printing process.
听起来你正在使用PrintControllerWithStatusDialog
PrintController.
警告:我无法验证基本的PrintController的行为方式不同.
根据这个MSDN Forum Posting PrintControllerWithStatusDialog是默认值:
他建议这样:
MyPrintDocument.PrintController = new System.Drawing.Printing.StandardPrintController();