Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to release all active forms
Message
From
01/09/2000 00:29:47
 
 
To
31/08/2000 10:44:10
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00411246
Message ID:
00411580
Views:
9
OK...if I recall, Toolbars are added to the _SCREEN.Forms collection and they don't have a Release method or a QueryUnload, so don't you have to trap for the existence of those methods first in this code?

>>How would I release all the opened forms after quiting or selecting the EXIT bar from the system menu.
>
>Like Nick said, you can step through the _screen.forms collection. I suggest putting that code in an exitapp routine that gets fired by your Menu, and in an ON SHUTDOWN (ON SHUTDOWN is how clicking the "X" in the main VFP Screen gets trapped).
>
>I would also add a little code to test to see if each form can be closed:
>
>
local llAbort
>for lnI = _screen.FormCount to 1 step -1
>	if _screen.Forms[lnI].QueryUnload()
>		_screen.Forms[lnI].Release()
>	else
>		llAbort = .T.
>		exit
>	endif
>endfor
>Then test llAbort to see if you can finish shutting down.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform