PaperSource Klass

Definition

Anger vilket pappersfack skrivaren ska hämta papper från.

public ref class PaperSource
public class PaperSource
[System.Serializable]
public class PaperSource
type PaperSource = class
[<System.Serializable>]
type PaperSource = class
Public Class PaperSource
Arv
PaperSource
Attribut

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

Den här klassen används av PrinterSettings.PaperSources och PageSettings.PaperSource egenskaper för att hämta papperskällans fack som är tillgängliga på skrivaren och för att ange papperskällan för en sida.

Mer information om utskrift finns i översikten över System.Drawing.Printing namnområdet.

Konstruktorer

Name Description
PaperSource()

Initierar en ny instans av PaperSource klassen.

Egenskaper

Name Description
Kind

Hämtar papperskällan.

RawKind

Hämtar eller anger heltal som representerar ett av PaperSourceKind värdena eller ett anpassat värde.

SourceName

Hämtar eller anger namnet på papperskällan.

Metoder

Name Description
Equals(Object)

Avgör om det angivna objektet är lika med det aktuella objektet.

(Ärvd från Object)
GetHashCode()

Fungerar som standard-hash-funktion.

(Ärvd från Object)
GetType()

Hämtar den aktuella instansen Type .

(Ärvd från Object)
MemberwiseClone()

Skapar en ytlig kopia av den aktuella Object.

(Ärvd från Object)
ToString()

Innehåller information om PaperSource i strängformuläret.

Gäller för

Se även