Freigeben über


PrintDocument.PrintController-Eigenschaft

Ruft den Druckercontroller ab, der den Druckvorgang steuert, oder legt diesen fest.

Namespace: System.Drawing.Printing
Assembly: System.Drawing (in system.drawing.dll)

Syntax

'Declaration
Public Property PrintController As PrintController
'Usage
Dim instance As PrintDocument
Dim value As PrintController

value = instance.PrintController

instance.PrintController = value
public PrintController PrintController { get; set; }
public:
property PrintController^ PrintController {
    PrintController^ get ();
    void set (PrintController^ value);
}
/** @property */
public PrintController get_PrintController ()

/** @property */
public void set_PrintController (PrintController value)
public function get PrintController () : PrintController

public function set PrintController (value : PrintController)

Eigenschaftenwert

Der PrintController, der den Druckvorgang steuert. Der Standardwert ist eine neue Instanz der PrintControllerWithStatusDialog-Klasse.

Hinweise

Ein Druckercontroller steuert den Druckvorgang in mehrfacher Hinsicht. Wenn Sie z. B. ein Dokument drucken möchten, müssen Sie es in ein Graphics-Objekt konvertieren. Ein PrintController gibt an, an welcher Position die Grafik in einem Bild für die Seitenansicht oder auf einem Drucker für das tatsächliche Drucken gezeichnet werden soll. Ein Druckercontroller kann auch bestimmen, ob ein Dokument sofort oder nach einem angegebenen Zeitraum gedruckt werden soll.

Beispiel

Für das folgende Codebeispiel muss zuvor eine Instanz der PrintDocument-Klasse mit dem Namen myPrintDocument erstellt werden. In diesem Beispiel wird eine neue Instanz der PrintController-Klasse erstellt und der PrintController-Eigenschaft von myPrintDocument zugewiesen. Dann wird das Dokument gedruckt.

Verwenden Sie für dieses Beispiel den System.Drawing.Printing-Namespace und den System.Windows.Forms-Namespace.

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
public void myPrint()
{
   if (useMyPrintController == true)
   {
      myPrintDocument.PrintController = 
         new myControllerImplementation();     
      if (wantsStatusDialog == true)
      {
         myPrintDocument.PrintController = 
            new PrintControllerWithStatusDialog
            (myPrintDocument.PrintController);
      }
   }
   myPrintDocument.Print();
}
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.set_PrintController
            (new MyControllerImplementation());
        if (wantsStatusDialog == true) {
            myPrintDocument.set_PrintController
                (new PrintControllerWithStatusDialog
                (myPrintDocument.get_PrintController()));
        }
    }
    myPrintDocument.Print();
} //MyPrint

.NET Framework-Sicherheit

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

PrintDocument-Klasse
PrintDocument-Member
System.Drawing.Printing-Namespace
PrintDocument.DefaultPageSettings-Eigenschaft
PrintDocument.DocumentName-Eigenschaft
PreviewPrintController-Klasse
PrintController-Klasse
PrintControllerWithStatusDialog
PrinterSettings
StandardPrintController