Spread Windows Forms 8.0 Product Documentation
PrintMessageBox Event
Example 


Occurs before and after a print job.
Syntax
'Declaration
 
Public Event PrintMessageBox As PrintMessageBoxEventHandler
'Usage
 
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.

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.
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!");
}
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

Reference

FpSpread Class
FpSpread Members
PrintMessageBoxEventArgs Class

User-Task Documentation

Managing Printing

 

 


Copyright © GrapeCity, inc. All rights reserved.