PrintControllerWithStatusDialog.OnStartPrint 方法

此方法支持 .NET 基础结构,但不适合在代码中直接使用。

开始控制序列,确定何时以及如何对文档进行打印。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Overrides Sub OnStartPrint ( _
    document As PrintDocument, _
    e As PrintEventArgs _
)
用法
Dim instance As PrintControllerWithStatusDialog
Dim document As PrintDocument
Dim e As PrintEventArgs

instance.OnStartPrint(document, e)
public override void OnStartPrint (
    PrintDocument document,
    PrintEventArgs e
)
public:
virtual void OnStartPrint (
    PrintDocument^ document, 
    PrintEventArgs^ e
) override
public void OnStartPrint (
    PrintDocument document, 
    PrintEventArgs e
)
public override function OnStartPrint (
    document : PrintDocument, 
    e : PrintEventArgs
)

参数

  • document
    PrintDocument,它表示当前正在打印的文档。

备注

PrintControllerWithStatusDialog 类调用封装的 PrintControllerPrintController.OnStartPrint 方法。

OnStartPrint 方法在 PrintDocument 引发 BeginPrint 事件后立即调用。

使用 OnStartPrint 可以确定文档的打印时间和打印方式。例如,可以将打印延迟 30 分钟或者对文档的打印机设置进行调整。OnStartPrint 创建发送到打印机的 Graphics 对象。调用 OnStartPrint 之后,OnStartPage 方法将 Graphics 对象设置为单页图形。OnEndPage 方法清除 Graphics 对象,而 OnEndPrint 方法释放该对象。

OnStartPrint 正好可以用于验证 PrinterSettings,这些设置应该是有效的。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

PrintControllerWithStatusDialog 类
PrintControllerWithStatusDialog 成员
System.Windows.Forms 命名空间