PrinterSettings.PrinterResolutionCollection.Count Property

 

Gets the number of available printer resolutions in the collection.

Namespace:   System.Drawing.Printing
Assembly:  System.Drawing (in System.Drawing.dll)

public int Count { get; }

Property Value

Type: System.Int32

The number of available printer resolutions in the collection.

The following code example populates the comboPrintResolution combo box with the supported resolutions. The example requires that a PrintDocument variable named printDoc exists and that the specific combo box exists.

// 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);
}

.NET Framework
Available since 1.1
Return to top
Show: