Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sys(1037)
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00620415
Message ID:
00620695
Views:
32
Thanks, Garrett. I got this to work. FWIW, here's the code I used:

I first dropped the CommonDialog control onto the form. Then I created a property on the form called "printcancel". In the Error method of the object I put the following code, I trapped for the 1429 OLE Error. The code for the Error method follows as well.
*!* cmdOK.Click method
*!* Need to set CancelError so that the control will generate an error.
*!* Otherwise, you cannot know if Cancel was clicked.
thisform.oleCommonDialog.CancelError = .T.
rv = thisform.oleCommonDialog.ShowPrinter()
if thisform.printcancel
	thisform.printcancel = .F.
	return
endif
*!* do reporting here

*!* cmdOK.Error method
LPARAMETERS nError, cMethod, nLine

if nError = 1429  && going to assume this meant Cancel was clicked on Print Dialog
	thisform.printcancel = .T.
endif
I still wish there was a more elegant way of trapping for the "Cancel" button. Oh well, this will do JUST FINE! Thanks again


>The Common Dialog control can do this. If you drop it on a form, you can right-click it and bring up the help file.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform