Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
QueryUnload or Release?
Message
 
To
24/11/2003 20:16:44
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00853142
Message ID:
00853150
Views:
22
>I have always used thisform.release in my command buttons that close a form so that I can access form properties if I need to before releasing all of the form's objects. However, I would like to allow the user to click on the 'X'in the top right hand corner of the form to also close the form and do some checks to determine if the form should be closed or not. Typically, this would be the same as pressing escape so I am prompting the user to exit the form or not and return to the form if necessary to continue editing so the user can save his changes. In testing, I noticed that clicking on the x does NOT run the form's release method, but queryunload. Hence, code that I had in the form's release method will have to be moved to queryunload. Yet calling queryunload from a command button does not seem to close the form. What is the best way to handle this? I don't want to put duplicate code in both queryunload and release...
>
>TIA!


Tracy,

I usually put the clean-up/form validation code in the Form.QueryUnload(). In the CloseCommandbutton.Click() I do this:
IF Thisform.QueryUnload()
	Thisform.Release()
ENDIF
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform