Windows Form 列印支援

Windows Forms 中的列印主要是使用 PrintDocument 元件元件 元件來讓使用者列印,以及 PrintPreviewDialog 控制項 PrintDialog 元件 PageSetupDialog 元件 元件,以提供熟悉的圖形介面給習慣于 Windows 作業系統的使用者。

一般而言,您會建立元件的新實例 PrintDocument 、設定描述如何使用 和 PageSettings 類別列印 PrinterSettings 的屬性,並呼叫 Print 方法來實際列印檔案。

從 Windows 應用程式列印期間,元件會顯示中止列印對話方塊, PrintDocument 以提醒使用者列印發生並允許取消列印工作。

本節內容

操作說明:建立標準的 Windows Forms 列印工作
說明如何使用 PrintDocument 元件從 Windows Form 列印。

操作說明:在執行階段從 PrintDialog 擷取使用者輸入
說明如何使用元件以程式設計方式修改選取的 PrintDialog 列印選項。

操作說明:在 Windows Forms 中選擇附加至使用者電腦的印表機
描述在執行時間將印表機變更為列印 PrintDialog 為 。

作法:列印 Windows Forms 中的圖形
描述將圖形傳送至印表機。

作法:在 Windows Forms 中列印多頁文字檔
描述將文字傳送至印表機。

操作說明:完成 Windows Forms 列印工作
說明如何警示使用者完成列印工作。

操作說明:列印 Windows Forms
示範如何列印目前表單的複本。

操作說明:使用預覽列印在 Windows Forms 中進行列印
示範如何使用 PrintPreviewDialog 來列印檔案。

PrintDocument 元件
說明元件的使用方式 PrintDocument

PrintDialog 元件
說明元件的使用方式 PrintDialog

PrintPreviewDialog 控制項
說明 控制項的使用 PrintPreviewDialog 方式。

PageSetupDialog Component
說明元件的使用方式 PageSetupDialog

System.Drawing.Printing
描述 命名空間中的 System.Drawing.Printing 類別。