Back to Devexpress

PrintDialogRunner.Instance Property

windowsforms-devexpress-dot-xtraprinting-dot-preview-dot-printdialogrunner.md

latest2.5 KB
Original Source

PrintDialogRunner.Instance Property

Assigns a default Print dialog.

Namespace : DevExpress.XtraPrinting.Preview

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public static PrintDialogRunner Instance { get; set; }
vb
Public Shared Property Instance As PrintDialogRunner

Property Value

TypeDescription
PrintDialogRunner

A DefaultPrintDialogRunner, or SystemPrintDialogRunner.

|

Example

To make the PrintTool.PrintDialog method invoke the standard system Print dialog, add the following code to the application’s Program.cs unit ( Program.vb in Visual Basic).

This will replace the DefaultPrintDialogRunner, returned by the PrintDialogRunner.Instance property, with a SystemPrintDialogRunner.

csharp
using DevExpress.XtraPrinting.Preview;
// ...

static void Main(string[] args) {
    PrintDialogRunner.Instance = new SystemPrintDialogRunner();
    // ...
}
vb
Imports DevExpress.XtraPrinting.Preview
' ...

Partial Friend Class MyApplication
    <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
    Public Sub New()
        ' ...
        PrintDialogRunner.Instance = New SystemPrintDialogRunner()
    End Sub
' ...
End Class

See Also

PrintDialog

PrintDialogRunner Class

PrintDialogRunner Members

DevExpress.XtraPrinting.Preview Namespace