PrinterSettings.PrinterResolutionCollection 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
包含 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實例。
如果 為 Custom
PrinterResolutionKind ,則分別使用 X 和 Y 屬性來判斷水準和垂直方向的自定義印表機解析度。
Printer |
初始化 PrinterSettings.PrinterResolutionCollection 類別的新執行個體。 |
Count |
取得集合中可用印表機解析度的數目。 |
Item[Int32] |
取得指定之索引處的 PrinterResolution。 |
Add(Printer |
將 PrinterResolution 加入至集合結尾。 |
Copy |
從指定的索引處開始,複製目前 PrinterSettings.PrinterResolutionCollection 的內容至指定的陣列。 |
Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
Get |
傳回可逐一查看這個集合的列舉程式。 |
Get |
做為預設雜湊函式。 (繼承來源 Object) |
Get |
取得目前執行個體的 Type。 (繼承來源 Object) |
Memberwise |
建立目前 Object 的淺層複製。 (繼承來源 Object) |
To |
傳回代表目前物件的字串。 (繼承來源 Object) |
ICollection. |
如需這個成員的說明,請參閱 CopyTo(Array, Int32)。 |
ICollection. |
如需這個成員的說明,請參閱 Count。 |
ICollection. |
如需這個成員的說明,請參閱 IsSynchronized。 |
ICollection. |
如需這個成員的說明,請參閱 SyncRoot。 |
IEnumerable. |
如需這個成員的說明,請參閱 GetEnumerator()。 |
Cast<TResult>(IEnumerable) |
將 IEnumerable 的項目轉換成指定的型別。 |
Of |
根據指定的型別來篩選 IEnumerable 的項目。 |
As |
啟用查詢的平行化作業。 |
As |
將 IEnumerable 轉換成 IQueryable。 |
產品 | 版本 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |