PrintDocument.PrintController Propriedade

Definição

Obtém ou define o controlador da impressora que guia o processo de impressão.Gets or sets the print controller that guides the printing process.

public:
 property System::Drawing::Printing::PrintController ^ PrintController { System::Drawing::Printing::PrintController ^ get(); void set(System::Drawing::Printing::PrintController ^ value); };
[System.ComponentModel.Browsable(false)]
public System.Drawing.Printing.PrintController PrintController { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.PrintController : System.Drawing.Printing.PrintController with get, set
Public Property PrintController As PrintController

Valor da propriedade

PrintController

O PrintController que guia o processo de impressão.The PrintController that guides the printing process. O padrão é uma nova instância da classe PrintControllerWithStatusDialog.The default is a new instance of the PrintControllerWithStatusDialog class.

Atributos

Exemplos

O exemplo de código a seguir requer que você tenha criado uma instância da PrintDocument classe que é nomeada myPrintDocument .The following code example requires that you have created an instance of the PrintDocument class that is named myPrintDocument. O exemplo cria uma nova instância da PrintController classe, atribui-a à PrintController propriedade de myPrintDocument e imprime o documento.The example creates a new instance of the PrintController class, assigns it to the PrintController property of myPrintDocument, and prints the document.

Use os System.Drawing.Printing System.Windows.Forms namespaces e para este exemplo.Use the System.Drawing.Printing and System.Windows.Forms namespaces for this example.

public:
   void myPrint()
   {
      if ( useMyPrintController == true )
      {
         myPrintDocument->PrintController =
            gcnew myControllerImplementation;
         if ( wantsStatusDialog == true )
         {
            myPrintDocument->PrintController =
               gcnew PrintControllerWithStatusDialog(
                  myPrintDocument->PrintController );
         }
      }
      myPrintDocument->Print();
   }
public void myPrint()
{
   if (useMyPrintController == true)
   {
      myPrintDocument.PrintController = 
         new myControllerImplementation();     
      if (wantsStatusDialog == true)
      {
         myPrintDocument.PrintController = 
            new PrintControllerWithStatusDialog
            (myPrintDocument.PrintController);
      }
   }
   myPrintDocument.Print();
}

Public Sub myPrint()
    If useMyPrintController = True Then
        myPrintDocument.PrintController = New myControllerImplementation()
        If wantsStatusDialog = True Then
            myPrintDocument.PrintController = _
               New PrintControllerWithStatusDialog( _
               myPrintDocument.PrintController)
        End If
    End If
    myPrintDocument.Print()
End Sub

Comentários

Um controlador de impressão orienta o processo de impressão de várias maneiras.A print controller guides the printing process in several ways. Por exemplo, para imprimir um documento, você precisa convertê-lo em um Graphics objeto.For example, to print a document, you need to convert it to a Graphics object. Um PrintController especifica onde desenhar o gráfico em uma imagem para uma visualização de impressão ou em uma impressora para realmente imprimir o documento.A PrintController specifies where to draw the graphic in an image for a print preview or on a printer to actually print the document. Um controlador de impressão também pode especificar se deseja imprimir um documento imediatamente ou aguardar um intervalo especificado.A print controller can also specify whether to print a document immediately, or wait a specified interval.

Aplica-se a

Confira também