System.Drawing.Printing.PrinterSettings.PrintRange Property

Gets or sets the page numbers that the user has specified to be printed.

Syntax

public PrintRange PrintRange { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The PrinterSettings.PrintRange property is used by the System.Windows.Forms.PrintDialog.when the user selects a print range. The default PrinterSettings.PrintRange is AllPages. To enable the user to specify a range of pages to print, the System.Windows.Forms.PrintDialog.AllowSomePages property must be set to true. To enable the user to specify the selected pages to print, the System.Windows.Forms.PrintDialog.AllowSelection property must be set to true.

During the printing process, in the PrintDocument.PrintPage event, view the PrinterSettings.PrintRange to determine what should be printed. If PrinterSettings.PrintRange is PrintRange.SomePages, use the PrinterSettings.FromPage and PrinterSettings.ToPage properties to determine what pages should be printed. If PrinterSettings.PrintRange is PrintRange.Selection, then specify output only for the selected pages.

The PrinterSettings.FromPage, PrinterSettings.ToPage and PrinterSettings.PrintRange can also be set programmatically, though the PrintDocument.PrintPage implementation is the same.

Requirements

Namespace: System.Drawing.Printing
Assembly: System.Drawing (in System.Drawing.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0