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

Glossary Item Box

Occurs before and after a print job.


Visual Basic (Declaration) 
Public Event PrintMessageBox As PrintMessageBoxEventHandler
Visual Basic (Usage)Copy Code
Dim instance As FpSpread
Dim handler As PrintMessageBoxEventHandler
AddHandler instance.PrintMessageBox, handler
public event PrintMessageBoxEventHandler PrintMessageBox

Event Data

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

AbortMessage Gets the message displayed if the print job is canceled.
BeginPrinting Gets whether the print job is beginning or ending.
Cancel Gets or sets whether to cancel the default abort message box.
Id Gets the print job identifier.


This event is raised by the OnPrintMessageBox method when the print job is started or ended.

The print message box displays the print job name, if provided, and lets users cancel the print job.

If you want to provide a name for a print job, set the PrintInfo.JobName property.

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

The PrintCancelled event can be used when the print job is cancelled.


This example raises the PrintMessageBox event when the print job is started or ended.
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?";

private void fpSpread1_PrintMessageBox(object sender, FarPoint.Win.Spread.PrintMessageBoxEventArgs e)
     ListBox1.Items.Add("PrintMessageBox 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)
End Sub

Private Sub FpSpread1_PrintMessageBox(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.PrintMessageBoxEventArgs) Handles
     ListBox1.Items.Add("PrintMessageBox event fired!")
End Sub


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.