Прочетете на английски Редактиране

Споделяне чрез


PrinterSettings.PrinterResolutionCollection.Item[Int32] Property

Definition

Gets the PrinterResolution at a specified index.

C#
public virtual System.Drawing.Printing.PrinterResolution this[int index] { get; }

Parameters

index
Int32

The index of the PrinterResolution to get.

Property Value

The PrinterResolution at the specified index.

Examples

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.

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

Applies to

Продукт Версии
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.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
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also