Skip to main content

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

Invokes a specified Print dialog.

Namespace: DevExpress.XtraPrinting.Preview

Assembly: DevExpress.XtraPrinting.v24.1.dll

NuGet Packages: DevExpress.Win.Navigation, DevExpress.Win.Printing

Declaration

public abstract DialogResult Run(
    PrintDocument document,
    UserLookAndFeel lookAndFeel,
    IWin32Window owner,
    PrintDialogAllowFlags flags
)

Parameters

Name Type Description
document PrintDocument

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

Type Description
DialogResult

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

Remarks

The type of the Print dialog that is returned by this method depends on the specified PrintDialogRunner.Instance value.

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.

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

static void Main(string[] args) {
    PrintDialogRunner.Instance = new SystemPrintDialogRunner();
    // ...
}
See Also