Share via


PrinterSettings.PaperSources Properti

Definisi

Mendapatkan baki sumber kertas yang tersedia pada pencetak.

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

Nilai Properti

Yang PrinterSettings.PaperSourceCollection mewakili baki sumber kertas yang tersedia pada pencetak ini.

Contoh

Contoh kode berikut mengisi kotak comboPaperSource kombo dengan sumber kertas yang didukung printer. SourceName diidentifikasi sebagai properti yang menyediakan string tampilan untuk item yang ditambahkan melalui DisplayMember properti kotak kombo. Contohnya mengharuskan PrintDocument variabel bernama printDoc ada dan kotak kombo tertentu ada.

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

Keterangan

PrinterSettings.PaperSourceCollection berisi PaperSource instans yang mewakili baki sumber kertas melalui PaperSource.Kind properti , yang berisi salah PaperSourceKind satu nilai.

Biasanya, Anda mengatur sumber kertas halaman melalui PageSettings.PaperSource properti ke valid PaperSource yang tersedia melalui PaperSources koleksi.

Berlaku untuk

Lihat juga