Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sys(1037)
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00620415
Message ID:
00620695
Vues:
34
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform