加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – 如何在printDocument.print()中打印打印对话框直接打印?

发布时间:2020-12-15 17:46:00 所属栏目:百科 来源:网络整理
导读:当我在使用C#编写的 Windows应用程序中使用MyPrintDocument.print()时,会显示一个对话框,该对话框显示Windows处理打印程序并使用取消按钮.我不想这个对话框显示,是可能吗? 如果没有,我应该使用哪种方式?我的程序使用热敏打印机. 解决方法 你使用哪个 Print
当我在使用C#编写的 Windows应用程序中使用MyPrintDocument.print()时,会显示一个对话框,该对话框显示Windows处理打印程序并使用取消按钮.我不想这个对话框显示,是可能吗?

如果没有,我应该使用哪种方式?我的程序使用热敏打印机.

解决方法

你使用哪个 PrintController?

The .NET Framework includes three print controllers that are derived from PrintController that help accomplish common tasks. The StandardPrintController prints a document to a printer. The PreviewPrintController generates a preview of what the document will look like when printed and is used by the PrintPreviewControl and PrintPreviewDialog classes. The PrintControllerWithStatusDialog provides a printing status dialog during the printing process.

听起来你正在使用PrintControllerWithStatusDialog PrintController.

警告:我无法验证基本的PrintController的行为方式不同.

根据这个MSDN Forum Posting PrintControllerWithStatusDialog是默认值:

他建议这样:

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读