Export (0) Print
Expand All

PrintControllerWithStatusDialog Class

Controls how a document is printed.

For a list of all members of this type, see PrintControllerWithStatusDialog Members.

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

[Visual Basic]
Public Class PrintControllerWithStatusDialog
   Inherits PrintController
[C#]
public class PrintControllerWithStatusDialog : PrintController
[C++]
public __gc class PrintControllerWithStatusDialog : public
   PrintController
[JScript]
public class PrintControllerWithStatusDialog extends
   PrintController

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

This class implements a PrintController and adds a status dialog. A print controller specifies how a PrintDocument is printed.

For a list of initial property values for an instance of PrintControllerWithStatusDialog, see the PrintControllerWithStatusDialog constructor.

Example

[Visual Basic, C#, C++] The following example shows how to create a new PrintController and assign it to the PrintController property. The 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.

[Visual Basic] 
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


[C#] 
void myPrint() {
   if (useMyPrintController==true) {
      myDocumentPrinter.PrintController = new myControllerImplementation();     
      if (wantsStatusDialog==true) {
         myDocumentPrinter.PrintController =
           new PrintControllerWithStatusDialog(myDocumentPrinter.PrintController);
      }
   }
   myDocumentPrinter.Print();
}


[C++] 
void myPrint() {
   if (useMyPrintController) {
      myDocumentPrinter->PrintController = new myControllerImplementation();     
      if (wantsStatusDialog) {
         myDocumentPrinter->PrintController =
           new PrintControllerWithStatusDialog(myDocumentPrinter->PrintController);
      }
   }
   myDocumentPrinter->Print();
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: System.Windows.Forms

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: System.Windows.Forms (in System.Windows.Forms.dll)

See Also

PrintControllerWithStatusDialog Members | System.Windows.Forms Namespace | PrintController

Show:
© 2014 Microsoft