Spread Windows Forms 6.0 Product Documentation
PrintAbort Event
See Also  Example Support Options
FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace > FpSpread Class : PrintAbort Event


Glossary Item Box

Occurs continually as printing occurs in order to give the user the opportunity to discontinue a print job.

Syntax

Visual Basic (Declaration) 
Public Event PrintAbort As PrintAbortEventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim handler As PrintAbortEventHandler
 
AddHandler instance.PrintAbort, handler
C# 
public event PrintAbortEventHandler PrintAbort

Event Data

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

PropertyDescription
Abort Gets or sets whether to discontinue the print job.

Remarks

This event is raised by the OnPrintAbort method when the user cancels the print job.

If you have the PrintInfo.AbortMessage property set, a message box appears with that message.

For more details on the individual event arguments, refer to PrintAbortEventArgs members.

Example

This example raises the PrintAbort event when the printing job is cancelled.
C#Copy Code
private void menu_Click(object sender, System.EventArgs e)
{
     FarPoint.Win.Spread.PrintInfo pi = new FarPoint.Win.Spread.PrintInfo();
     pi.AbortMessage = "Abort Printing?";
     fpSpread1.SetPrintInfo(pi,0);
     fpSpread1.PrintSheet(0);
}

private void fpSpread1_PrintAbort(object sender, FarPoint.Win.Spread.PrintAbortEventArgs e)
{
     ListBox1.Items.Add("PrintAbort event fired!");    
}
Visual BasicCopy Code
Private Sub Menu_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem23.Click
     Dim pi As New FarPoint.Win.Spread.PrintInfo()
     pi.AbortMessage = "Abort Printing?"
     FpSpread1.SetPrintInfo(pi, 0)
     FpSpread1.PrintSheet(0)
End Sub

Private Sub FpSpread1_PrintAbort(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.PrintAbortEventArgs) Handles FpSpread1.PrintAbort
     ListBox1.Items.Add("PrintAbort event fired!")
End Sub

Requirements

Target Platforms: 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

© 2002-2012 ComponentOne, a division of GrapeCity. All Rights Reserved.