PaperSource Klasa

Definicja

Określa tacę papieru, z której drukarka pobiera papier.

public ref class PaperSource
public class PaperSource
[System.Serializable]
public class PaperSource
type PaperSource = class
[<System.Serializable>]
type PaperSource = class
Public Class PaperSource
Dziedziczenie
PaperSource
Atrybuty

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 DisplayMember za pośrednictwem 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

Ta klasa służy do PrinterSettings.PaperSources pobierania zasobników źródła papieru dostępnych na drukarce i PageSettings.PaperSource ustawiania źródła papieru odpowiednio dla strony.

Aby uzyskać więcej informacji na temat drukowania, zobacz System.Drawing.Printing omówienie przestrzeni nazw.

Konstruktory

PaperSource()

Inicjuje nowe wystąpienie klasy PaperSource.

Właściwości

Kind

Pobiera źródło papieru.

RawKind

Pobiera lub ustawia liczbę całkowitą reprezentującą jedną z PaperSourceKind wartości lub wartość niestandardową.

SourceName

Pobiera lub ustawia nazwę źródła papieru.

Metody

Equals(Object)

Określa, czy dany obiekt jest taki sam, jak bieżący obiekt.

(Odziedziczone po Object)
GetHashCode()

Służy jako domyślna funkcja skrótu.

(Odziedziczone po Object)
GetType()

Type Pobiera wartość bieżącego wystąpienia.

(Odziedziczone po Object)
MemberwiseClone()

Tworzy płytkią kopię bieżącego Objectelementu .

(Odziedziczone po Object)
ToString()

Zawiera informacje o formularzu PaperSource w ciągu.

Dotyczy

Zobacz też