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

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/benwdm/article/details/84922486
....
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;

 

展开阅读全文

没有更多推荐了,返回首页