Back to Devexpress

DefaultPrintDialogRunner.Run(PrintDocument, UserLookAndFeel, IWin32Window, PrintDialogAllowFlags) Method

windowsforms-devexpress-dot-xtraprinting-dot-preview-dot-defaultprintdialogrunner-dot-run-x28-printdocument-userlookandfeel-iwin32window-printdialogallowflags-x29.md

latest4.8 KB
Original Source

DefaultPrintDialogRunner.Run(PrintDocument, UserLookAndFeel, IWin32Window, PrintDialogAllowFlags) Method

Invokes a customized Print dialog.

Namespace : DevExpress.XtraPrinting.Preview

Assembly : DevExpress.XtraPrinting.v25.2.dll

NuGet Package : DevExpress.Win.Printing

Declaration

csharp
public override DialogResult Run(
    PrintDocument document,
    UserLookAndFeel lookAndFeel,
    IWin32Window owner,
    PrintDialogAllowFlags flags
)
vb
Public Overrides Function Run(
    document As PrintDocument,
    lookAndFeel As UserLookAndFeel,
    owner As IWin32Window,
    flags As PrintDialogAllowFlags
) As DialogResult

Parameters

NameTypeDescription
documentPrintDocument

A PrintDocument.

| | lookAndFeel | UserLookAndFeel |

A UserLookAndFeel.

| | owner | IWin32Window |

An object implementing the IWin32Window interface that is the dialog owner.

| | flags | PrintDialogAllowFlags |

A PrintDialogAllowFlags enumeration value that enables editing of specific settings in the invoked dialog.

|

Returns

TypeDescription
DialogResult

A DialogResult enumeration value that specifies identifiers to indicate the return value of a dialog box.

|

Remarks

The following image illustrates the Print dialog invoked by this method as an alternative to the standard PrintDialog that is returned by the SystemPrintDialogRunner.Run method.

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

Run(PrintDocument, UserLookAndFeel, IWin32Window, PrintDialogAllowFlags)

PrintDialog

DefaultPrintDialogRunner Class

DefaultPrintDialogRunner Members

DevExpress.XtraPrinting.Preview Namespace