Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox.valid, escape, queryunload
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00604475
Message ID:
00604482
Vues:
23
>If you enter something in a textbox and press escape, the keypress event will fire before the textbox.valid enabling the form to close immediately. However, if the user clicks on the X (close) box, the textbox.valid fires before the queryunload method and there is no obvious way to inform the valid method that the user wants to close the form, not have the textbox contents validated. Is there a workaround?

Put the following in your base Form class KeyPress method:
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 27 AND nShiftAltCtrl = 0
	IF This.ActiveControl > 0 AND NOT This.ActiveControl.Valid()
		NODEFAULT
		RETURN
	ENDIF
ENDIF
DODEFAULT()
Mark McCasland
Midlothian, TX USA
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform