PrintControllerWithStatusDialog 類別

定義

控制從 Windows Form 應用程式列印文件的方式。

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==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 Forms 列印的詳細資訊,請參閱 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)

適用於

另請參閱