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 10:11:53
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
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:
00452197
Views:
22
>I need a way to detect whether a given form is currently in use or even better to generate a list of open forms.
>
>The reasons are two-fold. First, I want to restrict the user to one instance of a form and if he tries to open it again, I want the application to detect that fact and activate the existing instance rather than opening a second copy.
>
>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 cannot find any function or other mechanism to list the open form objects in an application, but I firmly believe that there has to be something.
>
>Thanks for any help.

_screen.forms collection and sys(1271) would help for looping. For first part you don't need to loop and just check :
FormIsOpen=type('SCXName')='O' ;
  and !isnull(SCXName) ;
  and SCXName.Baseclass = 'Form'
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform