Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Cancelling Printing with the Print Dialog

edited May 2006 in General
How do I know if the printing has been cancelled by clicking the Cancel
button on the Print Dialog?

I wish to avoid executing code in the OnPrintDialogClose event if the
Cancel button has been clicked.



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited May 2006
    ------------------------------------------
    Tech Tip: Detecting whether PrintDialog's
    Cancel button was Selected
    ------------------------------------------

    When the print dialog is displayed to the
    user, you can determine whether the Cancel
    button was selected by using the
    Report.OnPrintDialogClose event.

    Example:

    procedure TForm1.ppReport1PrintDialogClose(Sender: TObject);
    begin

    if ppReport1.PrintDialog.ModalResult = mrCancel then
    ShowMessage('Use chose to cancel the print request');

    end;


    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.