Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Weird ActiveForm behavior???
Message
From
06/10/2003 13:03:51
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00834452
Message ID:
00835451
Views:
15
Hi Sergey,

We have a function that does that ON SHUTDOWN. I am trying to close modal forms using the ActiveForm property. Problem is, some are nested modal forms (modal calling another modal) and I want to loop through those modal forms and release them.

The ON SHUTDOWN function cannot release the modal forms using a similar code as below.

BTW, I was able to make it work to meet my requirement. Since, the closing of the forms is done through a timer event, I just used a single IF..ENDIF construct in the timer event for ActiveForm.WindowType and set timer interval to .5 of a second so that
it fires almost as if from a single timer event. Then call QUIT to initiate on shutdown if the ActiveForm.WindowType is no longer modal or no forms.

>Ramil,
>
>It's simplier to release all forms using Screen's Forms collection.
<pre>
>  FOR i=_SCREEN.FormCount TO 1 STEP -1
>  	_SCREEN.Forms(i).Release()
>  ENDFOR
>
>
>>Hi all,
>>
>>I am trying to close all modal forms based on the _screen.ActiveForm property. I noticed that if I use a do while loop as in the function ShutDownAll(), the form oF1 will not be released. However, using the timer event to process the ActiveForms will close all the forms properly.
>>
>>Copy and paste the code snippet and run it from VFP7. Make sure that you click on the command button of the first form immediately as the timer will fire in 3 seconds.
>>
>>The code as it is will close all forms. Uncomment the three lines of code in the timer event so produce improper behavior.
>>
>>Appreciate any feedback or comments. TIA.
>>
ramil
~~ learning to stand still
Previous
Reply
Map
View

Click here to load this message in the networking platform