Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox.valid, escape, queryunload
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00604475
Message ID:
00604489
Views:
27
>>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()
>
*********
I want the form to close. My problem is that I also want the form to close when the user clicks on the X box, without running the textbox.valid, or at least have some way for the textbox.valid to know that the reason it fired is because the user clicks the X box, then it could just RETURN .T. and not validate.
Dr. Ken A. McGinnis
Healthcare software design
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform