Version

Printing Event

Occurs in response to a click on the 'Print' tool before the print operation begins.
Syntax
'Declaration
 
Public Event Printing As PrintingEventHandler
public event PrintingEventHandler Printing
Event Data

The event handler receives an argument of type PrintingEventArgs containing data related to this event. The following PrintingEventArgs properties provide information specific to this event.

PropertyDescription
Cancel (Inherited from System.ComponentModel.CancelEventArgs) 
DisplayPrintStatus Gets/sets whether a print status dialog will be displayed during the print operation.
Remarks

The Printing event is a cancellable event that may be used to cancel the print operation or just control whether the status dialog should be displayed during the print operation (using the DisplayPrintStatus).

Example
The following code gets called before a print operation is started from the UltraPrintPreviewDialog.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win
Imports Infragistics.Win.Printing
Imports Infragistics.Win.UltraWinGrid
Imports Infragistics.Win.UltraWinScrollBar
Imports Infragistics.Win.UltraWinToolbars


    Private Sub ultraPrintPreviewDialog1_Printing(ByVal sender As Object, ByVal e As Infragistics.Win.Printing.PrintingEventArgs) Handles ultraPrintPreviewDialog1.Printing

        ' cast the sender to a UltraPrintPreviewDialog
        Dim printPreviewDialog As UltraPrintPreviewDialog = CType(sender, UltraPrintPreviewDialog)

        ' specify whether a status dialog will be displayed
        ' during the print operation
        e.DisplayPrintStatus = True

        ' to cancel the print operation set Cancel to true
        ' e.Cancel = true

    End Sub
using Infragistics.Win;
using Infragistics.Win.Printing;
using Infragistics.Win.UltraWinGrid;
using Infragistics.Win.UltraWinScrollBar;
using Infragistics.Win.UltraWinToolbars;

		private void ultraPrintPreviewDialog1_Printing(object sender, Infragistics.Win.Printing.PrintingEventArgs e)
		{
			// cast the sender to a UltraPrintPreviewDialog
 			UltraPrintPreviewDialog printPreviewDialog = sender as UltraPrintPreviewDialog;

			// specify whether a status dialog will be displayed
			// during the print operation
			e.DisplayPrintStatus = true;

			// to cancel the print operation set Cancel to true
			// e.Cancel = true;
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also