Export (0) Print
Expand All

PrinterSettings.PrintRange Property

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

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

public PrintRange PrintRange { get; set; }

Property Value

Type: System.Drawing.Printing.PrintRange
One of the PrintRange values.

ExceptionCondition
InvalidEnumArgumentException

The value of the PrintRange property is not one of the PrintRange values.

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

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

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

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft