PrintControllerWithStatusDialog 类    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
控制如何从 Windows 窗体应用程序中打印文档。
public ref class PrintControllerWithStatusDialog : System::Drawing::Printing::PrintControllerpublic class PrintControllerWithStatusDialog : System.Drawing.Printing.PrintControllertype PrintControllerWithStatusDialog = class
    inherit PrintControllerPublic Class PrintControllerWithStatusDialog
Inherits PrintController- 继承
示例
下面的代码示例演示如何创建新 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==true) {
      myDocumentPrinter.PrintController = new myControllerImplementation();     
      if (wantsStatusDialog==true) {
         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) | 初始化 PrintControllerWithStatusDialog 类的新实例,并包装所提供的 PrintController。 | 
| PrintControllerWithStatusDialog(PrintController, String) | 初始化 PrintControllerWithStatusDialog 类的新实例,该实例包装所提供的 PrintController 并为对话框指定标题。 | 
属性
| IsPreview | 获取一个值,该值指示此 PrintControllerWithStatusDialog 用于打印预览。 | 
| IsPreview | 获取一个值,该值指示 PrintController 是否用于打印预览。(继承自 PrintController) | 
方法
| 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) |