FastReport中如何实现自定义预览窗口关闭事件

阅读更多
....
interface

uses
  .....,frxPreview, frxClass;

type
 TForm1 = class(TForm)
   frxReport1: TfrxReport;
   procedure frxReport1Preview(Sender: TObject);
   procedure FormCreate(Sender: TObject);
 end;

var
 Form1: TForm1;
 OldCloseEvent:TCloseEvent;

implementation
procedure NewOnClose(Sender: TObject; var Action: TCloseAction);
begin
 OldCloseEvent(Sender,Action);
 ShowMessage('Preview Closed');
end;

procedure TForm1.frxReport1Preview(Sender: TObject);
begin
 OldCloseEvent := frxReport1.PreviewForm.OnClose;
 @frxReport1.PreviewForm.OnClose := @NewOnClose;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
frxReport1.ShowReport();
end;

 

你可能感兴趣的:(FastReport中如何实现自定义预览窗口关闭事件)