共用方式為


WorkflowView.PrintDocument 屬性

定義

取得與 PrintDocument 相關聯的 WorkflowView

public:
 property System::Drawing::Printing::PrintDocument ^ PrintDocument { System::Drawing::Printing::PrintDocument ^ get(); };
public System.Drawing.Printing.PrintDocument PrintDocument { get; }
member this.PrintDocument : System.Drawing.Printing.PrintDocument
Public ReadOnly Property PrintDocument As PrintDocument

屬性值

PrintDocument

PrintDocument 物件,可將輸出傳送至印表機。

範例

下列範例將示範如何取得 PrintDocument 物件、顯示 PrintDialog 並關聯使用者在列印文件前選擇的 PrinterSettings

public void Print()
{
    System.Drawing.Printing.PrintDocument doc = this.workflowView.PrintDocument;
    PrintDialog dlg = new PrintDialog();
    if (dlg.ShowDialog() == DialogResult.OK)
    {
        doc.PrinterSettings = dlg.PrinterSettings;
        doc.Print();
    }
}
Public Sub Print()
    Dim doc As System.Drawing.Printing.PrintDocument = Me.workflowView.PrintDocument
    Dim dlg As New PrintDialog()
    If dlg.ShowDialog() = DialogResult.OK Then
        doc.PrinterSettings = dlg.PrinterSettings
        doc.Print()
    End If
End Sub

備註

使用 PrintDocument 物件來設定屬性,描述如何列印,並呼叫 Print 方法來開始列印程序。

適用於