PrinterSettings.PaperSources Właściwość

Definicja

Pobiera zasobniki źródła papieru, które są dostępne na drukarce.

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

Wartość właściwości

Element PrinterSettings.PaperSourceCollection reprezentujący zasobniki źródła papieru, które są dostępne na tej drukarce.

Przykłady

Poniższy przykład kodu wypełnia comboPaperSource pole kombi obsługiwanymi źródłami papieru drukarki. Element SourceName jest identyfikowany jako właściwość, która udostępnia ciąg wyświetlania elementu dodawanego za pośrednictwem DisplayMember właściwości pola kombi. Przykład wymaga, aby zmienna PrintDocument o nazwie printDoc istnieje i że istnieje określone pole kombi.

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

Uwagi

PaperSource Zawiera PrinterSettings.PaperSourceCollection wystąpienia reprezentujące zasobniki źródła papieru za pośrednictwem PaperSource.Kind właściwości, która zawiera jedną z PaperSourceKind wartości.

Zazwyczaj można ustawić źródło papieru strony za pomocą PageSettings.PaperSource właściwości na prawidłową PaperSource dostępną za pośrednictwem PaperSources kolekcji.

Dotyczy

Zobacz też