Spread Windows Forms 7.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.

Syntax

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
C# 
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.

PropertyDescription
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.
IsPreview Gets whether this event is for the PrintPreview

Remarks

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.

Example

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?";
     fpSpread1.SetPrintInfo(pi,0);
     fpSpread1.PrintSheet(0);
}

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)
     FpSpread1.PrintSheet(0)
End Sub

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

Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8

See Also

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