PaperSource.SourceName Eigenschap

Definitie

Hiermee haalt u de naam van de papierbron op of stelt u deze in.

public:
 property System::String ^ SourceName { System::String ^ get(); void set(System::String ^ value); };
public:
 property System::String ^ SourceName { System::String ^ get(); };
public string SourceName { get; set; }
public string SourceName { get; }
member this.SourceName : string with get, set
member this.SourceName : string
Public Property SourceName As String
Public ReadOnly Property SourceName As String

Waarde van eigenschap

De naam van de papierbron.

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

Roep deze eigenschap aan wanneer de papierbron moet worden weergegeven. De naam van de papierbron wordt gegenereerd op basis van de Kind eigenschap.

Van toepassing op

Zie ook