PrintControllerWithStatusDialog.OnEndPrint(PrintDocument, PrintEventArgs) 方法


完成确定何时以及如何对文档进行打印的控制序列。Completes the control sequence that determines when and how to print a document.

 override void OnEndPrint(System::Drawing::Printing::PrintDocument ^ document, System::Drawing::Printing::PrintEventArgs ^ e);
public override void OnEndPrint (System.Drawing.Printing.PrintDocument document, System.Drawing.Printing.PrintEventArgs e);
override this.OnEndPrint : System.Drawing.Printing.PrintDocument * System.Drawing.Printing.PrintEventArgs -> unit
Public Overrides Sub OnEndPrint (document As PrintDocument, e As PrintEventArgs)



PrintDocument,它表示当前正在打印的文档。A PrintDocument that represents the document currently being printed.


包含事件数据的 PrintPageEventArgsA PrintPageEventArgs that contains the event data.


PrintControllerWithStatusDialog类对 PrintController.OnEndPrint 封装的调用方法 PrintControllerThe PrintControllerWithStatusDialog class calls the PrintController.OnEndPrint method on the encapsulated PrintController.

OnEndPrint 引发事件后立即调用方法 PrintDocument EndPrintThe OnEndPrint method is called immediately after the PrintDocument raises the EndPrint event.

OnStartPrint方法创建 Graphics 发送到打印机的对象。The OnStartPrint method creates the Graphics object that is sent to the printer. OnStartPrint调用后,该 OnStartPage 方法会将 Graphics 对象设置为单个页面的图形。After OnStartPrint is called, the OnStartPage method sets the Graphics object to a graphic of a single page. (使用 OnStartPrint 来确定何时以及如何打印文档。(Use OnStartPrint to determine when and how to print a document. 例如,你可以将打印延迟30分钟,或者调整文档的打印机设置。 ) OnEndPage 方法会清除 Graphics 对象,同时 OnEndPrint 释放对象。For example, you can delay printing for 30 minutes or adjust the printer settings for the document.) The OnEndPage method clears the Graphics object, while OnEndPrint deallocates the object.