Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Do I Prevent Multiple Instances Of The Same Form
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00255528
Message ID:
00255553
Views:
14
Hi Doug,

Store the name of the form to an array (i.e. iaFormsActive) of an object (say cusFormsActive). Make sure your application instantiates an instance of oFormsActive when it boots, with something like the following line:

oFormsActive = CREATEOBJECT( "cusFormsActive" )

Each form can then add its .Name property to oFormsActive.iaFormsActive when it first instantiates. When a new form instantiates, look through the array, and if the .Name property of the form is found, issue formname.Show() rather than starting another instance of the form.

Evan Pauley


Doug White wrote:
>I have a VLS (Very Large Scale)database application, which allows moving rapidly from one form to another and back.
>I have noticed that in several cases, that a user is able to get multiple instances of the same form running, which may be hidden behind the main screen.
>
>How can I test for whether or not a form is already running, and just activate it, instead of DOing another instance?
Evan Pauley, MCP
Positronic Technology Systems LLC
Knoxville, TN

If a vegetarian eats vegetables, what does a humanitarian eat?
Previous
Reply
Map
View

Click here to load this message in the networking platform