# Displaying an Abort Message for the User

Learn how to display an abort message in your application to give users the option to cancel or continue printing. Explore the PrintAbortEventArgs class, PrintMessageBoxEventArgs class, PrintInfo class, AbortMessage property, FpSpread class, and more.

## Content

Spread provides a way for you to display an abort message to allow your end user a chance to cancel or continue with the printing.
For more information, refer to the following:

* [PrintAbortEventArgs](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintAbortEventArgs.html) class
* [PrintMessageBoxEventArgs](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintMessageBoxEventArgs.html) class
* [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) class, **AbortMessage** property
* [FpSpread](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.FpSpread.html) class, **PrintMessageBox** event, **PrintAbort** Event, and **PrintCancelled** Event

## Using Code

1. Create and set the **AbortMessage** property for a [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) object.
2. Set the **SheetView** object [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.SheetView.PrintInfo.html) property to the [PrintInfo](/spreadnet/api/latest/online-win/FarPoint.Win.Spread/FarPoint.Win.Spread.PrintInfo.html) object you just created.

## Example

This example brings up the cancel dialog.

```csharp
FarPoint.Win.Spread.PrintInfo pi = new FarPoint.Win.Spread.PrintInfo();
pi.AbortMessage = "Do you want to cancel printing??";
fpSpread1.ActiveSheet.PrintInfo = pi;
fpSpread1.PrintSheet(0);
```

```vbnet
Dim pi As New FarPoint.Win.Spread.PrintInfo
pi.AbortMessage = "Do you want to cancel printing??"
fpSpread1.Sheets(0).PrintInfo = pi
' Print the sheet
fpSpread1.PrintSheet(0)
```

## See Also

[Displaying a Print Dialog for the User](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printuser/spwin-printdialog)
[Providing a Preview of the Printing](/spreadnet/docs/latest/online-win/overview/spwin-devguide/spwin-printing/spwin-printuser/spwin-printpreview)