模态窗体中动态创建打印预览窗体出错!(100分)

  • 主题发起人 主题发起人 yangtsehua
  • 开始时间 开始时间
Y

yangtsehua

Unregistered / Unconfirmed
GUEST, unregistred user!
unit uSelectPrint;
//用于用户选择需打印的字段
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, DB, DBClient;
type
TfrmSelectPrint = class(TForm)
GroupBox1: TGroupBox;
checkb_khjg: TCheckBox;
checkb_hm: TCheckBox;
checkb_zh: TCheckBox;
checkb_xdmm: TCheckBox;
checkb_sfzh: TCheckBox;
checkb_dzpzmm: TCheckBox;
checkb_tkmm: TCheckBox;
checkb_jrkmm: TCheckBox;
checkb_myemail: TCheckBox;
checkb_bgxhm: TCheckBox;
checkb_jgurl: TCheckBox;
checkb_khsj: TCheckBox;
checkb_yyyxm: TCheckBox;
checkb_yyydh: TCheckBox;
checkb_yyysj: TCheckBox;
checkb_other1: TCheckBox;
checkb_yzty: TCheckBox;
checkb_bz: TCheckBox;
btn_next: TBitBtn;
BitBtn1: TBitBtn;
ClientDataSet1: TClientDataSet;
procedure BitBtn1Click(Sender: TObject);
procedure btn_nextClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
frmSelectPrint: TfrmSelectPrint;
implementation
uses uPrint;
{$R *.dfm}
procedure TfrmSelectPrint.BitBtn1Click(Sender: TObject);
begin
close;
end;

procedure TfrmSelectPrint.btn_nextClick(Sender: TObject);
begin
frmprint:=Tfrmprint.Create(nil);
try
frmprint.QuickRep1.PreviewModal;
//调用的时候出错
finally
frmprint.Free;
end;
self.ModalResult:=MROK;
close;
end;

end.

出错: Access Violation at address 004dec92 in module 'account.exe',Read of address 0000000.
好像是quickrep1没有创建,不知道怎么做?谢谢。
 
用preview,不要用previewmodal
 
谢谢。我已经自己解决了。知道是xpmenu控件和预览窗体的冲突。具体说不上来,希望
了解根本原因的老大能跟贴。
 

Similar threads

I
回复
0
查看
732
import
I
I
回复
0
查看
628
import
I
S
回复
0
查看
751
SUNSTONE的Delphi笔记
S
后退
顶部