if PrinterSetupDialog1.Execute then //这个是用于判断用户按下的是 PrinterSetupDialog1的[确定]
if PrinterSetupDialog1.Execute then //这个是用于判断用户按下的是 PrinterSetupDialog1的[确定]以上当然可以,可是不是我所要的,现在问题是: 用语句: qreport1.QRPrinter.PrintSetup;调用QuickReport的打印设置窗口
whbo(王红波(在失望的田野上...)) 能不能详细点,给个例子.
函数都有返回值,大多数函数可以根据返回值来判断函数进行的是什么操作,你可以看这个函数的帮助,我手头没有这个控件,所以不多说了,举个msgbox的例子(摘自delphi帮助),希望你能举一反三: MessageBox(const Text, Caption: PChar; Flags: Longint = MB_OK): Integer; Value Numeric value MeaningIDOK 1 The user chose the OK button. IDCANCEL 2 The user chose the Cancel button. IDABORT 3 The user chose the Abort button. IDRETRY 4 The user chose the Retry button. IDIGNORE 5 The user chose the Ignore button. IDYES 6 The user chose the Yes button. IDNO 7 The user chose the No button.
部分代码: ...... QReport1.Prepare; QReport1.PrinterSetup;//PrinterSetup不是函数,QR报表组件的方法,好像没有返回值的; if 用户确定 then //这里是关键,如何捕捉用户是确定还是取消 QReport1.Print else QReport1.free; .......
PrinterSetupDialog1的[确定]以上当然可以,可是不是我所要的,现在问题是:
用语句: qreport1.QRPrinter.PrintSetup;调用QuickReport的打印设置窗口
MessageBox(const Text, Caption: PChar; Flags: Longint = MB_OK): Integer;
Value Numeric value MeaningIDOK 1 The user chose the OK button.
IDCANCEL 2 The user chose the Cancel button.
IDABORT 3 The user chose the Abort button.
IDRETRY 4 The user chose the Retry button.
IDIGNORE 5 The user chose the Ignore button.
IDYES 6 The user chose the Yes button.
IDNO 7 The user chose the No button.
QReport1.PrinterSetup;//PrinterSetup不是函数,QR报表组件的方法,好像没有返回值的;
if 用户确定 then //这里是关键,如何捕捉用户是确定还是取消
QReport1.Print
else
QReport1.free; .......
then [OK] is clicked
else [CANCEL] is clicked.
如何捕捉用户按下的是 [确定]? 还是 [取消]?
没有回答我就结贴了.
我看未必,你只需要在运行后检查一下你的preinter的设置属性是否符合要求即可