Språk

PrinterSettings.PaperSources Egenskap

Definition

Hämtar papperskällans fack som är tillgängliga på skrivaren.

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

Egenskapsvärde

En PrinterSettings.PaperSourceCollection som representerar papperskällans fack som är tillgängliga på den här skrivaren.

Exempel

I följande kodexempel fylls comboPaperSource kombinationsrutan med skrivarens papperskällor som stöds. SourceName Identifieras som den egenskap som tillhandahåller visningssträngen för objektet som läggs till via DisplayMember egenskapen för kombinationsrutan. Exemplet kräver att en PrintDocument variabel med namnet printDoc finns och att den specifika kombinationsrutan finns.

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

Kommentarer

Innehåller PrinterSettings.PaperSourceCollectionPaperSource instanser som representerar papperskällans fack via PaperSource.Kind egenskapen, som innehåller ett av PaperSourceKind värdena.

Vanligtvis anger du en sidas papperskälla via egenskapen PageSettings.PaperSource till en giltig PaperSource tillgänglig via PaperSources samlingen.

Gäller för

Se även