PrintDocument.PrintController Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit le contrôleur d’impression qui guide le processus d’impression.
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
Valeur de propriété
Qui PrintController guide le processus d’impression. La valeur par défaut est une nouvelle instance de la PrintControllerWithStatusDialog classe.
- Attributs
Exemples
L’exemple de code suivant nécessite que vous ayez créé une instance de la PrintDocument classe nommée myPrintDocument. L’exemple crée une nouvelle instance de la PrintController classe, l’affecte à la PrintController propriété de myPrintDocument, puis imprime le document.
Utilisez les espaces de noms et System.Windows.Forms les System.Drawing.Printing espaces de noms pour cet exemple.
public:
void myPrint()
{
if ( useMyPrintController)
{
myPrintDocument->PrintController =
gcnew myControllerImplementation;
if ( wantsStatusDialog)
{
myPrintDocument->PrintController =
gcnew PrintControllerWithStatusDialog(
myPrintDocument->PrintController );
}
}
myPrintDocument->Print();
}
public void myPrint()
{
if (useMyPrintController)
{
myPrintDocument.PrintController =
new myControllerImplementation();
if (wantsStatusDialog)
{
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
Remarques
Un contrôleur d’impression guide le processus d’impression de plusieurs façons. Par exemple, pour imprimer un document, vous devez le convertir en objet Graphics . Spécifie PrintController où dessiner le graphique dans une image pour un aperçu avant impression ou sur une imprimante pour imprimer réellement le document. Un contrôleur d’impression peut également spécifier s’il faut imprimer un document immédiatement ou attendre un intervalle spécifié.