PrintControllerWithStatusDialog PrintControllerWithStatusDialog PrintControllerWithStatusDialog PrintControllerWithStatusDialog Class

定义

控制如何从 Windows 窗体应用程序中打印文档。Controls how a document is printed from a Windows Forms application.

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
继承
PrintControllerWithStatusDialogPrintControllerWithStatusDialogPrintControllerWithStatusDialogPrintControllerWithStatusDialog

示例

下面的代码示例演示如何创建一个新PrintController并将其分配给PrintController属性。The following code example shows how to create a new PrintController and assign it to the PrintController property. 该示例假定您已添加System.Drawing.Printing命名空间的类和你已创建的新实例PrintDocument作为myDocumentPrinterThe example assumes that you have added the System.Drawing.Printing namespace to the class and that you have created a new instance of a PrintDocument as 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并添加状态对话框。This class implements a PrintController and adds a status dialog box. 指定一个打印控制器如何PrintDocument打印。A print controller specifies how a PrintDocument is printed.

有关 PrintControllerWithStatusDialog 类的实例的初始属性值列表,请参见 PrintControllerWithStatusDialog 构造函数。For a list of initial property values for an instance of the PrintControllerWithStatusDialog class, see the PrintControllerWithStatusDialog constructor.

有关使用 Windows 窗体进行打印的详细信息,请参阅System.Drawing.Printing命名空间概述。For more information about printing with Windows Forms, see the System.Drawing.Printing namespace overview. 如果你想要从 Windows Presentation Foundation 应用程序打印,请参阅System.Printing命名空间。If you want to print from a Windows Presentation Foundation application, see the System.Printing namespace.

构造函数

PrintControllerWithStatusDialog(PrintController) PrintControllerWithStatusDialog(PrintController) PrintControllerWithStatusDialog(PrintController) PrintControllerWithStatusDialog(PrintController)

初始化 PrintControllerWithStatusDialog 类的新实例,并包装所提供的 PrintControllerInitializes a new instance of the PrintControllerWithStatusDialog class, wrapping the supplied PrintController.

PrintControllerWithStatusDialog(PrintController, String) PrintControllerWithStatusDialog(PrintController, String) PrintControllerWithStatusDialog(PrintController, String) PrintControllerWithStatusDialog(PrintController, String)

初始化 PrintControllerWithStatusDialog 类的新实例,该实例包装所提供的 PrintController 并为对话框指定标题。Initializes a new instance of the PrintControllerWithStatusDialog class, wrapping the supplied PrintController and specifying a title for the dialog box.

属性

IsPreview IsPreview IsPreview IsPreview

获取一个值,该值指示此 PrintControllerWithStatusDialog 用于打印预览。Gets a value indicating this PrintControllerWithStatusDialog is used for print preview.

方法

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
OnEndPage(PrintDocument, PrintPageEventArgs) OnEndPage(PrintDocument, PrintPageEventArgs) OnEndPage(PrintDocument, PrintPageEventArgs) OnEndPage(PrintDocument, PrintPageEventArgs)

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

OnEndPrint(PrintDocument, PrintEventArgs) OnEndPrint(PrintDocument, PrintEventArgs) OnEndPrint(PrintDocument, PrintEventArgs) OnEndPrint(PrintDocument, PrintEventArgs)

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

OnStartPage(PrintDocument, PrintPageEventArgs) OnStartPage(PrintDocument, PrintPageEventArgs) OnStartPage(PrintDocument, PrintPageEventArgs) OnStartPage(PrintDocument, PrintPageEventArgs)

开始特定控制序列,该序列确定文档页的打印时间和打印方式。Begins the control sequence that determines when and how to print a page of a document.

OnStartPrint(PrintDocument, PrintEventArgs) OnStartPrint(PrintDocument, PrintEventArgs) OnStartPrint(PrintDocument, PrintEventArgs) OnStartPrint(PrintDocument, PrintEventArgs)

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

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

适用于

另请参阅