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 |
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.
Property | Description |
---|---|
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 |
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.
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 Basic | Copy 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 |
Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8
Reference
FpSpread ClassFpSpread Members
PrintMessageBoxEventArgs Class