Freigeben über


PaperSource.SourceName-Eigenschaft

Ruft den Namen der Papierzufuhr ab oder legt diesen fest.

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

Syntax

'Declaration
Public Property SourceName As String
'Usage
Dim instance As PaperSource
Dim value As String

value = instance.SourceName

instance.SourceName = value
public string SourceName { get; set; }
public:
property String^ SourceName {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_SourceName ()

/** @property */
public void set_SourceName (String value)
public function get SourceName () : String

public function set SourceName (value : String)

Eigenschaftenwert

Der Name der Papierzufuhr.

Hinweise

Rufen Sie diese Eigenschaft auf, wenn die Papierzufuhr angezeigt werden muss. Der Name der Papierzufuhr wird anhand der Kind-Eigenschaft generiert.

Beispiel

Im folgenden Codebeispiel wird das comboPaperSource-Kombinationsfeld mit der unterstützten Papierzufuhr des Druckers gefü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. In diesem 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

PaperSource-Klasse
PaperSource-Member
System.Drawing.Printing-Namespace
PaperSourceKind