PrinterSettings.FromPage 属性

定义

获取或设置要打印的第一页的页码。Gets or sets the page number of the first page to print.

public:
 property int FromPage { int get(); void set(int value); };
public int FromPage { get; set; }
member this.FromPage : int with get, set
Public Property FromPage As Integer

属性值

要打印的第一页的页码。The page number of the first page to print.

异常

FromPage 属性的值小于零。The FromPage property's value is less than zero.

注解

当用户选择打印范围时,PrintDialog 将使用 FromPageToPage 属性。The FromPage and ToPage properties are used by the PrintDialog when the user selects a print range. PrintDialog.AllowSomePages 属性必须设置为 true,以使用户能够指定打印范围。The PrintDialog.AllowSomePages property must be set to true to enable the user to specify a print range. 此外,PrintDialog 需要指定 MinimumPageMaximumPage,并且 FromPage 值在该范围内。In addition, the PrintDialog requires the MinimumPage and MaximumPage to be specified and the FromPage value to be within that range.

在打印过程中,在 PrintDocument.PrintPage 事件中查看 PrintRange 以确定应打印的内容。During the printing process, in the PrintDocument.PrintPage event, view the PrintRange to determine what should be printed. 如果 PrintRange.SomePagesPrintRange,请使用 FromPageToPage 属性来确定应打印的页面。If PrintRange is PrintRange.SomePages, use the FromPage and ToPage properties to determine what pages should be printed. 如果 PrintRange.SelectionPrintRange,则只为所选页面指定输出。If PrintRange is PrintRange.Selection, then specify output only for the selected pages.

还可以通过编程方式设置 FromPageToPagePrintRange,尽管 PrintDocument.PrintPage 实现是相同的。The FromPage, ToPage and PrintRange can also be set programmatically, though the PrintDocument.PrintPage implementation is the same.

适用于

另请参阅