PaperSource 類別

定義

指定印表機取得紙張的紙匣。

public ref class PaperSource
public class PaperSource
[System.Serializable]
public class PaperSource
type PaperSource = class
[<System.Serializable>]
type PaperSource = class
Public Class PaperSource
繼承
PaperSource
屬性

範例

下列程式碼範例會將 comboPaperSource 印表機支援的紙張來源填入下拉式方塊。 SourceName會識別為 屬性,這個屬性會提供透過下拉式方塊的 屬性新增 DisplayMember 之專案的顯示字串。 此範例要求 PrintDocument 名為 的 printDoc 變數存在,而且特定的下拉式方塊存在。

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

備註

和 屬性會使用此 PrinterSettings.PaperSourcesPageSettings.PaperSource 類別來取得印表機上可用的紙張來源匣,以及分別設定頁面的紙張來源。

如需列印的詳細資訊,請參閱 System.Drawing.Printing 命名空間概觀。

建構函式

PaperSource()

初始化 PaperSource 類別的新執行個體。

屬性

Kind

取得紙張來源。

RawKind

取得或設定整數,表示其中一個 PaperSourceKind 值或自訂值。

SourceName

取得或設定紙張來源的名稱。

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

以字串形式提供 PaperSource 的相關資訊。

適用於

另請參閱