Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How can you tell what forms are open?
Message
From
12/12/2000 11:25:18
 
 
To
12/12/2000 10:05:31
Eric Sedlacek
TTSS Interactive Products
Rockville, Maryland, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00452191
Message ID:
00452266
Views:
19
>I need a way to detect whether a given form is currently in use or even better to generate a list of open forms.

YOu can use _screen.Forms and Sys(1271) like Cetin said, but this is why most people create their own FOrms Manager. You might want to try something like that.

>Second, I want to be able to do a cleanup procedure when the application is closed. This procedure would close all open forms and notify the user is there is any trouble closing any of the forms.

I put this code in the QueryUnload event of the forms. Add a NODEFAULT and a RETURN .F. if the form can't be closed at the current time. NODEFAULT is required by VFP to prevent closing a form with the "X" button. RETURN .F. is so you can do something like this:
llContinue = .T.
for lnI = _screen.formcount to 1 step -1
	if _screen.Forms[lnI].QueryUnload()
		_screen.Forms[lnI].Release()
	else
		llCOntinue = .F.
		exit
	endif
endfor
ANd then check the value of llCOntinue to see if the was a problem or not.
Previous
Reply
Map
View

Click here to load this message in the networking platform