Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preventing multiple instances of a form
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00018445
Message ID:
00018509
Views:
34
>>>>Does anyone have a way of preventing multiple instances of a form without setting the Form WindowType property to 1-Modal?
>>>
>>>I beleive you'll only receive general ways of accomplishing your task until a little more is known about how and where you are calling the form form, if from another form or a menu. If you are calling from your menu just issue a *skip for WEXIST("formname") and that option will be disabled when you refresh the menu. This will be by far the easiest and less cumbersome way of doing what you need.
>>>
>>>HTH
>>
>>
>>Less cumbersome, but not as fun!:) I want the form to be acitivated if it is chosen again from the menu.
>
>Check for the existence of the form in your init method using wexist(). If your init method returns(.F.), the form will not load. You could also activate the existing form from here.


This is where VFP is kind of strange. In the init method wexist() always returns true, because by the time the init method has run, the form is "loaded" into memory already.

I have written a routing to "spin" thru the _screen.forms(x).name and _screen.forms(x).visible property to see if the window exist, which works fine.

The problem lies in returning a .f. from the int method of one form in a formset does not close down the whole formset.

Is there a way to close down the formset from the init method of a form in the formset? I have tried thisformset.release() to no avail.


Richard.
Previous
Reply
Map
View

Click here to load this message in the networking platform