Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close all forms?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00284684
Message ID:
00285703
Views:
16
>>Hi George,
>>
>>>It would seem, however, to be unnecessary to implement such a procedure (not to mention inconsistent) with the way things work in Windows.
>>
>>I suppose its a preference: If you have forms that rely on another form, then you start closing them down one by one, and you kill a main form, and the child forms QueryUnload fails, you have an orphaned form that will cause errors later on. You could trap that in the QueryUnload of the parent form, but I'd rather do it my way: make sure all forms are ready to close beofre you close any. I suppose its a preference.
>
>Mike,
>
>I don't have this problem. Any form that's created as a result of call from another form is always modal. The rule of thumb being that only data editing forms are modeless and everything else is modal. This completely removes the issue since the user must deal with the modal form prior to doing anything else. The code that I posted earlier today is called both by a menu option (Close All) and when the user tries to quit.

The intelligent way of closing forms is to have additional column in form manager forms collection. This column will keep reference to 'parent' form, i.e. will be filled for 'child' form only. Therefore, when closing (all forms or some particular form) it will check first for 'childs' close them and only after this will close itself.
Edward Pikman
Independent Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform