Sdílet prostřednictvím


PrinterSettings.PaperSources Vlastnost

Definice

Získá zdrojové zásobníky papíru, které jsou k dispozici na tiskárně.

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

Hodnota vlastnosti

A PrinterSettings.PaperSourceCollection , který představuje zdrojové zásobníky papíru, které jsou k dispozici na této tiskárně.

Příklady

Následující příklad kódu naplní comboPaperSource pole se seznamem podporovanými zdroji papíru tiskárny. Označuje SourceName se jako vlastnost, která poskytuje zobrazovaný řetězec pro položku, která je přidána prostřednictvím DisplayMember vlastnosti pole se seznamem. Příklad vyžaduje, aby proměnná PrintDocument s názvem printDoc existuje a že existuje konkrétní pole se seznamem.

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

Poznámky

Obsahuje PrinterSettings.PaperSourceCollectionPaperSource instance, které představují zásobníky papíru prostřednictvím PaperSource.Kind vlastnosti, která obsahuje jednu z PaperSourceKind hodnot.

Obvykle nastavíte zdroj papíru stránky prostřednictvím PageSettings.PaperSource vlastnosti na platnou PaperSource dostupnou PaperSources prostřednictvím kolekce.

Platí pro

Viz také