Freigeben über


PrinterSettings.PaperSources-Eigenschaft

Ruft die bei diesem Drucker verfügbaren Papierzufuhrschächte ab.

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

Syntax

'Declaration
Public ReadOnly Property PaperSources As PaperSourceCollection
'Usage
Dim instance As PrinterSettings
Dim value As PaperSourceCollection

value = instance.PaperSources
public PaperSourceCollection PaperSources { get; }
public:
property PaperSourceCollection^ PaperSources {
    PaperSourceCollection^ get ();
}
/** @property */
public PaperSourceCollection get_PaperSources ()
public function get PaperSources () : PaperSourceCollection

Eigenschaftenwert

Eine PrinterSettings.PaperSourceCollection, die die verfügbaren Papierzufuhrschächte dieses Druckers darstellt.

Hinweise

PrinterSettings.PaperSourceCollection enthält PaperSource-Instanzen, die die Papierzufuhrschächte mithilfe der PaperSource.Kind-Eigenschaft darstellen, die einen der PaperSourceKind-Werte enthält.

Üblicherweise legen Sie die Papierzufuhr der Seite mithilfe der PageSettings.PaperSource-Eigenschaft auf eine gültige PaperSource fest, die über die PaperSources-Auflistung verfügbar ist.

Beispiel

Im folgenden Codebeispiel wird das comboPaperSource-Kombinationsfeld mit den unterstützten Papierquellen des Druckers aufgefüllt. Der SourceName wird als die Eigenschaft identifiziert, die die Anzeigezeichenfolge für das Element bereitstellt, das von der DisplayMember-Eigenschaft des Kombinationsfelds hinzugefügt wird. Im Beispiel müssen eine PrintDocument-Variable mit dem Namen printDoc und das bestimmte Kombinationsfeld vorhanden sein.

' 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
// 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.set_DisplayMember("SourceName");

PaperSource pkSource;
for (int i = 0; i < printDoc.get_PrinterSettings().get_PaperSources().
    get_Count(); i++) {
    pkSource = printDoc.get_PrinterSettings().get_PaperSources().
        get_Item(i);
    comboPaperSource.get_Items().Add(pkSource);
}

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

PrinterSettings-Klasse
PrinterSettings-Member
System.Drawing.Printing-Namespace
PaperSource-Klasse
PrinterSettings.PaperSourceCollection
PrinterSettings.InstalledPrinters-Eigenschaft
PrinterSettings.PaperSizes-Eigenschaft
PrinterResolutions
ListControl.DisplayMember