PrinterSettings.PaperSources Eigenschap

Definitie

Hiermee haalt u de papierbronlades op die beschikbaar zijn op de printer.

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

Waarde van eigenschap

Een PrinterSettings.PaperSourceCollection die de papierbronlades vertegenwoordigt die beschikbaar zijn op deze printer.

Voorbeelden

In het volgende codevoorbeeld wordt de comboPaperSource keuzelijst met invoervak gevuld met de ondersteunde papierbronnen van de printer. De SourceName eigenschap wordt aangeduid als de eigenschap die de weergavetekenreeks biedt voor het item dat wordt toegevoegd via de DisplayMember eigenschap van de keuzelijst met invoervak. Voor het voorbeeld is vereist dat een PrintDocument benoemde printDoc variabele bestaat en dat de specifieke keuzelijst met invoervak bestaat.

// 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

Opmerkingen

De PrinterSettings.PaperSourceCollection bevat PaperSource exemplaren die de papierbronlades vertegenwoordigen via de PaperSource.Kind eigenschap, die een van de PaperSourceKind waarden bevat.

Normaal gesproken stelt u de papierbron van een pagina via de PageSettings.PaperSource eigenschap in op een geldige PaperSource waarde die beschikbaar is via de PaperSources verzameling.

Van toepassing op

Zie ook