PrintControllerWithStatusDialog 类

定义

控制如何从Windows 窗体应用程序中打印文档。

public ref class PrintControllerWithStatusDialog : System::Drawing::Printing::PrintController
public class PrintControllerWithStatusDialog : System.Drawing.Printing.PrintController
type PrintControllerWithStatusDialog = class
    inherit PrintController
Public Class PrintControllerWithStatusDialog
Inherits PrintController
继承
PrintControllerWithStatusDialog

示例

下面的代码示例演示如何创建新 PrintController 属性并将其分配给 PrintController 该属性。 该示例假定已将 System.Drawing.Printing 命名空间添加到类,并且已创建一个新实例 PrintDocument 作为 myDocumentPrinter

void myPrint()
{
   if ( useMyPrintController )
   {
      myDocumentPrinter->PrintController = gcnew myControllerImplementation;
      if ( wantsStatusDialog )
      {
         myDocumentPrinter->PrintController =
            gcnew PrintControllerWithStatusDialog( myDocumentPrinter->PrintController );
      }
   }
   myDocumentPrinter->Print();
}
void myPrint() {
   if (useMyPrintController) {
      myDocumentPrinter.PrintController = new myControllerImplementation();     
      if (wantsStatusDialog) {
         myDocumentPrinter.PrintController =
           new PrintControllerWithStatusDialog(myDocumentPrinter.PrintController);
      }
   }
   myDocumentPrinter.Print();
}
Sub myPrint()
    If useMyPrintController = True Then
        myDocumentPrinter.PrintController = New myControllerImplementation()
        If wantsStatusDialog = True Then
            myDocumentPrinter.PrintController = _
               New PrintControllerWithStatusDialog(myDocumentPrinter.PrintController)
        End If
    End If
    myDocumentPrinter.Print()
End Sub

注解

此类实现 PrintController 并添加状态对话框。 打印控制器指定打印方式 PrintDocument

有关类实例 PrintControllerWithStatusDialog 的初始属性值列表,请参阅 PrintControllerWithStatusDialog 构造函数。

有关使用 Windows 窗体打印的详细信息,请参阅 System.Drawing.Printing 命名空间概述。 如果要从 Windows Presentation Foundation 应用程序打印,请参阅 System.Printing 命名空间。

构造函数

名称 说明
PrintControllerWithStatusDialog(PrintController, String)

初始化类的新实例 PrintControllerWithStatusDialog ,包装提供的 PrintController 和为对话框指定标题。

PrintControllerWithStatusDialog(PrintController)

初始化类的新实例 PrintControllerWithStatusDialog ,包装所提供的 PrintController

属性

名称 说明
IsPreview

获取一个值, PrintControllerWithStatusDialog 该值指示用于打印预览。

方法

名称 说明
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetType()

获取当前实例的 Type

(继承自 Object)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
OnEndPage(PrintDocument, PrintPageEventArgs)

完成控制序列,确定文档页面的打印时间和方式。

OnEndPrint(PrintDocument, PrintEventArgs)

完成控制序列,确定何时以及如何打印文档。

OnStartPage(PrintDocument, PrintPageEventArgs)

开始控制序列,该序列确定文档页面的打印时间和方式。

OnStartPrint(PrintDocument, PrintEventArgs)

开始控制序列,该序列确定文档的打印时间和方式。

ToString()

返回一个表示当前对象的字符串。

(继承自 Object)

适用于

另请参阅