|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
modal dialog boxI need to popup a tiny modal dialog box when a user clicks on the "Print"
button to force the user to wait for printing process to finish before he/she can continue. The model dialog box should go away when the printing is done. Any sample code is greatly appreciated. Bill Hi,
Doesnt the print document control throw one up for you which allows you to cancel the print? Ken ---------------------- Show quoteHide quote "Bill nguyen" <billn_nospam_please@jaco.com> wrote in message news:uYDBHW4FGHA.1396@TK2MSFTNGP11.phx.gbl... >I need to popup a tiny modal dialog box when a user clicks on the "Print" >button to force the user to wait for printing process to finish before >he/she can continue. The model dialog box should go away when the printing >is done. > Any sample code is greatly appreciated. > > > Bill > > "Bill nguyen" <billn_nospam_please@jaco.com> schrieb You don't have to show it modally because the Print method does not return > I need to popup a tiny modal dialog box when a user clicks on the > "Print" button to force the user to wait for printing process to > finish before he/she can continue. The model dialog box should go > away when the printing is done. > Any sample code is greatly appreciated. before printing has finished: dim f as new waitform f.show f.refresh pd.print f.close We now have the problem of having an "unresponsive" Form. To avoid this, you can only use multiple threads, because Print does lock the UI thread. Version 1: Print on a different thread. In this case, you can show a dialog box modally. In addition, handle the PD's EndPrint event to close the modal Form there. Version 2: Print on the same thread but show a dialog box modally (or modeless + application.run) in a different thread. Armin it's not about the printing process. I'm using CrystalReport
Document.PrintReport, not PrintDocument class. I just want the user to stay off the form until the printing process is done. If the printing process fails for some reason, the modal form should go away. Bill Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:%23cWOSp4FGHA.3856@TK2MSFTNGP12.phx.gbl... > "Bill nguyen" <billn_nospam_please@jaco.com> schrieb >> I need to popup a tiny modal dialog box when a user clicks on the >> "Print" button to force the user to wait for printing process to >> finish before he/she can continue. The model dialog box should go >> away when the printing is done. >> Any sample code is greatly appreciated. > > > You don't have to show it modally because the Print method does not return > before printing has finished: > > dim f as new waitform > > f.show > f.refresh > pd.print > f.close > > > We now have the problem of having an "unresponsive" Form. To avoid this, > you can only use multiple threads, because Print does lock the UI thread. > > Version 1: > Print on a different thread. In this case, you can show a dialog box > modally. In addition, handle the PD's EndPrint event to close the modal > Form there. > > Version 2: > Print on the same thread but show a dialog box modally (or modeless + > application.run) in a different thread. > > > Armin > > > "Bill Nguyen" <billn_nospam_please@jaco.com> schrieb Didn't know you're using CR.> it's not about the printing process. I'm using CrystalReport > Document.PrintReport, not PrintDocument class. > I just want the user to stay off the form until the printing process > is done. If the printing process fails for some reason, the modal > form should go away. IMO, it's not ok how CR works in this situation: PrintReport does not return but you are still able to use your Forms. This can cause reentrance. PrintReport or one of it's sub procedures internally processes messages (like application.doevents), thus you are asking for a modal form, which is understandable. One solution is to show a modal Form, and in it's Activated event, start PrintReport. You have to pass the reference to the CRViewer in this case. Another solution is to print on a different thread, then show the modal Form. When PrintReport has finished, close the modal Form. Armin Bill nguyen wrote:
> I need to popup a tiny modal dialog box when a user clicks on the "Print" Take a look at the 'PrintDocument' object's 'PrintController' property.> button to force the user to wait for printing process to finish before > he/she can continue. The model dialog box should go away when the printing > is done. > Any sample code is greatly appreciated. -- Herfried K. Wagner
VS2003 to VS2005 Conversion
Email attachments? Module and Class Probably an intro question -> starting window over? calling form_load? Copying DataRows to another DataTable win32 dll vb.net pointers receiving data - HELP MDI's Declaring Variables Within a If Steatement Locking Application to HDD Sr.No. problem in declaring streamwriter object |
|||||||||||||||||||||||