Version

Print Method (UltraPrintPreviewControl)

Invokes Print on the associated Document.
Syntax
'Declaration
 
Public Sub Print( _
   ByVal showStatusDialog As Boolean _
) 
public void Print( 
   bool showStatusDialog
)

Parameters

showStatusDialog
A boolean indicating whether to display a status dialog during the print operation.
Remarks

The Print method is used to invoke the System.Drawing.Printing.PrintDocument.Print method. The showStatusDialog parameter is used to determine which printcontroller will be used for the print operation. If showStatusDialog is false, then the System.Drawing.Printing.StandardPrintController is used, otherwise the UltraPrintPreviewControl's custom status print controller is used.

Example
This snippet shows how you can delay the generation of the print preview. It also shows how to print the generated preview.

Public Sub New()

   InitializeComponent()
   
   ' Prevent the control from automatically generating the print preview
   ' when the Form loads.
   '
   Me.ultraPrintPreviewControl1.AutoGeneratePreview = False

End Sub


Private Sub btnGeneratePreview_Click(sender As Object, e As System.EventArgs) Handles Me.btnGeneratePreview.Click

   ' Tell the control to generate the print preview.
   '
   Me.ultraPrintPreviewControl1.GeneratePreview(False)

End Sub


Private Sub btnPrint_Click(sender As Object, e As System.EventArgs) Handles Me.btnPrint.Click

   ' Tell the control to print.  Passing true means that
   ' it will display a status dialog.
   '
   Me.ultraPrintPreviewControl1.Print(True)

End Sub
public PrintPreviewForm()
{
	InitializeComponent();

	// Prevent the control from automatically generating the print preview
	// when the Form loads.
	//
	this.ultraPrintPreviewControl1.AutoGeneratePreview = false;
}

private void btnGeneratePreview_Click(object sender, System.EventArgs e)
{
	// Tell the control to generate the print preview.
	//
	this.ultraPrintPreviewControl1.GeneratePreview( false );
}

private void btnPrint_Click(object sender, System.EventArgs e)
{
	// Tell the control to print.  Passing true means that
	// it will display a status dialog.
	//
	this.ultraPrintPreviewControl1.Print( 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