PrinterSettings.FromPage Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the page number of the first page to print.

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

public int FromPage { get; set; }

Property Value

Type: System.Int32

The page number of the first page to print.

Exception Condition
ArgumentException

The FromPage property's value is less than zero.

The FromPage and ToPage properties are used by the PrintDialog when the user selects a print range. The PrintDialog.AllowSomePages property must be set to true to enable the user to specify a print range. In addition, the PrintDialog requires the MinimumPage and MaximumPage to be specified and the FromPage value to be within that range.

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
Available since 1.1
Return to top
Show: