您说 的应该是不弹出打印对话框直接打印吧,可以参考下面的代码
- System.Drawing.Printing.PrintDocument myPrintDocument = new System.Drawing.Printing.PrintDocument();
- //myPrintDocument.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
- //myPrintDocument.PrinterSettings.FromPage = 2;
- //myPrintDocument.PrinterSettings.ToPage = 4;
- myPrintDocument.PrinterSettings.PrintRange = System.Drawing.Printing.PrintRange.SomePages;
- myPrintDocument.PrinterSettings.FromPage = _textControl.InputPosition.Page;
- myPrintDocument.PrinterSettings.ToPage = _textControl.InputPosition.Page;
- _textControl.Print(myPrintDocument);
复制代码 |