Edit

Share via


PrintControllerWithStatusDialog Class

Definition

Controls how a document is printed from a Windows Forms application.

C#
public class PrintControllerWithStatusDialog : System.Drawing.Printing.PrintController
Inheritance
PrintControllerWithStatusDialog

Examples

The following code 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.

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

Remarks

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

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

For more information about printing with Windows Forms, see the System.Drawing.Printing namespace overview. If you want to print from a Windows Presentation Foundation application, see the System.Printing namespace.

Constructors

PrintControllerWithStatusDialog(PrintController, String)

Initializes a new instance of the PrintControllerWithStatusDialog class, wrapping the supplied PrintController and specifying a title for the dialog box.

PrintControllerWithStatusDialog(PrintController)

Initializes a new instance of the PrintControllerWithStatusDialog class, wrapping the supplied PrintController.

Properties

IsPreview

Gets a value indicating this PrintControllerWithStatusDialog is used for print preview.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnEndPage(PrintDocument, PrintPageEventArgs)

Completes the control sequence that determines when and how to print a page of a document.

OnEndPrint(PrintDocument, PrintEventArgs)

Completes the control sequence that determines when and how to print a document.

OnStartPage(PrintDocument, PrintPageEventArgs)

Begins the control sequence that determines when and how to print a page of a document.

OnStartPrint(PrintDocument, PrintEventArgs)

Begins the control sequence that determines when and how to print a document.

ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also