共用方式為


PrinterSettings.PrinterResolutionCollection.Count 屬性

定義

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

public:
 property int Count { int get(); };
public int Count { get; }
member this.Count : int
Public ReadOnly Property Count As Integer

屬性值

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

實作

範例

下列程式代碼範例會 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

適用於