Share via


PaperSource Kelas

Definisi

Menentukan baki kertas tempat pencetak mendapatkan kertas.

public ref class PaperSource
public class PaperSource
[System.Serializable]
public class PaperSource
type PaperSource = class
[<System.Serializable>]
type PaperSource = class
Public Class PaperSource
Warisan
PaperSource
Atribut

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

Kelas ini digunakan oleh PrinterSettings.PaperSources properti dan PageSettings.PaperSource untuk mendapatkan baki sumber kertas yang tersedia pada printer dan untuk mengatur sumber kertas untuk halaman.

Untuk informasi selengkapnya tentang pencetakan, lihat System.Drawing.Printing gambaran umum namespace.

Konstruktor

PaperSource()

Menginisialisasi instans baru kelas PaperSource.

Properti

Kind

Mendapatkan sumber kertas.

RawKind

Mendapatkan atau mengatur bilangan bulat yang mewakili salah PaperSourceKind satu nilai atau nilai kustom.

SourceName

Mendapatkan atau mengatur nama sumber kertas.

Metode

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan dari instans Type saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari saat ini Object.

(Diperoleh dari Object)
ToString()

Menyediakan informasi tentang PaperSource formulir dalam string.

Berlaku untuk

Lihat juga