Thank you both.
不过我觉得采用继承TQRStandardPreview的方法比较容易。
TmQRStandardPreview= class(TQRStandardPreview)
procedure PrintClick(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.QuickRep1Preview(Sender: TObject);
var v: TmQRStandardPreview;
begin
v := TmQRStandardPreview.CreatePreview(self,TQRPrinter(Sender));// .Create(self);
v.LastPage.Enabled := False;
v.Show ;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
QuickRep1.Preview ;
end;
{ TmQRStandardPreview }
procedure TmQRStandardPreview.PrintClick(Sender: TObject);
begin
if messagedlg('really want print?',mtconfirmation, [mbyes,mbno],0)=mrno then
exit;
inherited;
end;