PrintControllerWithStatusDialog 类

控制文档的打印方式。

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

语法

声明
Public Class PrintControllerWithStatusDialog
    Inherits PrintController
用法
Dim instance As PrintControllerWithStatusDialog
public class PrintControllerWithStatusDialog : PrintController
public ref class PrintControllerWithStatusDialog : public PrintController
public class PrintControllerWithStatusDialog extends PrintController
public class PrintControllerWithStatusDialog extends PrintController

备注

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

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

示例

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

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
void myPrint() {
   if (useMyPrintController==true) {
      myDocumentPrinter.PrintController = new myControllerImplementation();     
      if (wantsStatusDialog==true) {
         myDocumentPrinter.PrintController =
           new PrintControllerWithStatusDialog(myDocumentPrinter.PrintController);
      }
   }
   myDocumentPrinter.Print();
}
void myPrint()
{
   if ( useMyPrintController )
   {
      myDocumentPrinter->PrintController = gcnew myControllerImplementation;
      if ( wantsStatusDialog )
      {
         myDocumentPrinter->PrintController =
            gcnew PrintControllerWithStatusDialog( myDocumentPrinter->PrintController );
      }
   }
   myDocumentPrinter->Print();
}
void MyPrint()
{
    if (useMyPrintController == true) {
        myDocumentPrinter.set_PrintController
            (new MyControllerImplementation());

        if (wantsStatusDialog == true) {
            myDocumentPrinter.set_PrintController
                (new PrintControllerWithStatusDialog
                (myDocumentPrinter.get_PrintController()));
        }
    }
    myDocumentPrinter.Print();
} //MyPrint

继承层次结构

System.Object
   System.Drawing.Printing.PrintController
    System.Windows.Forms.PrintControllerWithStatusDialog

线程安全

此类型的任何公共静态(Visual Basic 中的 Shared)成员都是线程安全的,但不保证所有实例成员都是线程安全的。

平台

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 成员
System.Windows.Forms 命名空间
PrintController