PrinterSettings.PaperSources 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 les bacs sources de papier disponibles sur l’imprimante.
public:
property System::Drawing::Printing::PrinterSettings::PaperSourceCollection ^ PaperSources { System::Drawing::Printing::PrinterSettings::PaperSourceCollection ^ get(); };
public System.Drawing.Printing.PrinterSettings.PaperSourceCollection PaperSources { get; }
member this.PaperSources : System.Drawing.Printing.PrinterSettings.PaperSourceCollection
Public ReadOnly Property PaperSources As PrinterSettings.PaperSourceCollection
Valeur de propriété
Qui PrinterSettings.PaperSourceCollection représente les bacs sources de papier disponibles sur cette imprimante.
Exemples
L’exemple de code suivant remplit la comboPaperSource zone de liste modifiable avec les sources papier prises en charge par l’imprimante. La SourceName propriété est identifiée comme la propriété qui fournit la chaîne d’affichage de l’élément ajouté via la DisplayMember propriété de la zone de liste déroulante. L’exemple nécessite qu’une PrintDocument variable nommée printDoc existe et que la zone de liste modifiable spécifique existe.
// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display String*.
comboPaperSource->DisplayMember = "SourceName";
PaperSource^ pkSource;
for ( int i = 0; i < printDoc->PrinterSettings->PaperSources->Count; i++ )
{
pkSource = printDoc->PrinterSettings->PaperSources[ i ];
comboPaperSource->Items->Add( pkSource );
}
// Add list of paper sources found on the printer to the combo box.
// The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember="SourceName";
PaperSource pkSource;
for (int i = 0; i < printDoc.PrinterSettings.PaperSources.Count; i++){
pkSource = printDoc.PrinterSettings.PaperSources[i];
comboPaperSource.Items.Add(pkSource);
}
' Add list of paper sources found on the printer to the combo box.
' The DisplayMember property is used to identify the property that will provide the display string.
comboPaperSource.DisplayMember = "SourceName"
Dim pkSource As PaperSource
For i = 0 to printDoc.PrinterSettings.PaperSources.Count - 1
pkSource = printDoc.PrinterSettings.PaperSources.Item(i)
comboPaperSource.Items.Add(pkSource)
Next
Remarques
PaperSource Contient PrinterSettings.PaperSourceCollection des instances qui représentent les bacs sources de papier via la PaperSource.Kind propriété, qui contient l’une des PaperSourceKind valeurs.
En règle générale, vous définissez la source de papier d’une page par le biais de la PageSettings.PaperSource propriété sur une valeur valide PaperSource disponible via la PaperSources collection.