PrinterSettings.PrinterResolutionCollection 類別

定義

包含 PrinterResolution 物件的集合。

public: ref class PrinterSettings::PrinterResolutionCollection : System::Collections::ICollection
public class PrinterSettings.PrinterResolutionCollection : System.Collections.ICollection
type PrinterSettings.PrinterResolutionCollection = class
    interface ICollection
    interface IEnumerable
Public Class PrinterSettings.PrinterResolutionCollection
Implements ICollection
繼承
PrinterSettings.PrinterResolutionCollection
實作

範例

下列程式碼範例會 comboPrintResolution 以支援的解析度填入下拉式方塊。 此範例會要求 PrintDocument 名為 printDoc 的變數存在,而且有特定的下拉式方塊存在。

// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display String.
PrinterResolution^ pkResolution;
for ( int i = 0; i < printDoc->PrinterSettings->PrinterResolutions->Count; i++ )
{
   pkResolution = printDoc->PrinterSettings->PrinterResolutions[ i ];
   comboPrintResolution->Items->Add( pkResolution );
}
// Add list of printer resolutions found on the printer to the combobox.
// The PrinterResolution's ToString() method will be used to provide the display string.

PrinterResolution pkResolution;
for (int i = 0; i < printDoc.PrinterSettings.PrinterResolutions.Count; i++){
    pkResolution = printDoc.PrinterSettings.PrinterResolutions[i];
    comboPrintResolution.Items.Add(pkResolution);
}
' Add list of printer resolutions found on the printer to the combobox.
' The PrinterResolution's ToString() method will be used to provide the display string.
Dim pkResolution As PrinterResolution
For i = 0 to printDoc.PrinterSettings.PrinterResolutions.Count - 1
    pkResolution = printDoc.PrinterSettings.PrinterResolutions.Item(i)
    comboPrintResolution.Items.Add(pkResolution)
Next

備註

PrinterSettings.PrinterResolutionCollection包含 PrinterResolution 實例,表示透過 PrinterResolution.Kind 屬性支援的印表機解析度,其中包含其中 PrinterResolutionKind 一個值。

一般而言,您會透過 PageSettings.PrinterResolution 屬性將印表機的解析度設定為可透過 PrinterResolutions 集合取得的有效 PrinterResolution 實例。

如果 PrinterResolutionKindCustom ,則分別使用 XY 屬性來判斷水準和垂直方向的自訂印表機解析度。

建構函式

PrinterSettings.PrinterResolutionCollection(PrinterResolution[])

初始化 PrinterSettings.PrinterResolutionCollection 類別的新執行個體。

屬性

Count

取得集合中可用印表機解析度的數目。

Item[Int32]

取得指定之索引處的 PrinterResolution

方法

Add(PrinterResolution)

PrinterResolution 加入至集合結尾。

CopyTo(PrinterResolution[], Int32)

從指定的索引處開始,複製目前 PrinterSettings.PrinterResolutionCollection 的內容至指定的陣列。

Equals(Object)

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

(繼承來源 Object)
GetEnumerator()

傳回可逐一查看這個集合的列舉程式。

GetHashCode()

做為預設雜湊函式。

(繼承來源 Object)
GetType()

取得目前執行個體的 Type

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複製。

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。

(繼承來源 Object)

明確介面實作

ICollection.CopyTo(Array, Int32)

如需這個成員的說明,請參閱 CopyTo(Array, Int32)

ICollection.Count

如需這個成員的說明,請參閱 Count

ICollection.IsSynchronized

如需這個成員的說明,請參閱 IsSynchronized

ICollection.SyncRoot

如需這個成員的說明,請參閱 SyncRoot

IEnumerable.GetEnumerator()

如需這個成員的說明,請參閱 GetEnumerator()

擴充方法

Cast<TResult>(IEnumerable)

IEnumerable 的項目轉換成指定的型別。

OfType<TResult>(IEnumerable)

根據指定的型別來篩選 IEnumerable 的項目。

AsParallel(IEnumerable)

啟用查詢的平行化作業。

AsQueryable(IEnumerable)

IEnumerable 轉換成 IQueryable

適用於

另請參閱