Muokkaa

Jaa


PrinterSettings.PrintRange Property

Definition

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

public:
 property System::Drawing::Printing::PrintRange PrintRange { System::Drawing::Printing::PrintRange get(); void set(System::Drawing::Printing::PrintRange value); };
public System.Drawing.Printing.PrintRange PrintRange { get; set; }
member this.PrintRange : System.Drawing.Printing.PrintRange with get, set
Public Property PrintRange As PrintRange

Property Value

One of the PrintRange values.

Exceptions

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

Remarks

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.

Applies to

See also