下面是我在D7中測試的源代碼﹐一切正常
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, QuickRpt, QRPrev;
type
TForm1 = class(TForm)
QuickRep1: TQuickRep;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
proceduredo
FormChanged(Sender: Tobject);
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.DoFormChanged(Sender : Tobject);
//¦pªG¤W­±¦³©w¸q³o­Ó¨ç¼Æ¡M¤U­±´N­n¥[¤WTForm1
begin
if Assigned(Screen.OnActiveFormChange) then
Screen.OnActiveFormChange:=nil;
if Screen.ActiveForm is TQRStandardPreview then
begin
with TQRStandardPreview(Screen.ActiveForm)do
begin
Left:=0;
Top:=0;
Height:=Screen.Height;
Width:=Screen.Width;
PrintSetup.Visible := False;
Print.Visible := False;
end;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
Screen.OnActiveFormChange:=DoFormChanged;
QuickRep1.Preview;
end;
end.