Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Executing a menu command from a form?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00088965
Message ID:
00088975
Vues:
28
>>>Is there anyway to execute a menu item programmatically from a form?
>>>There is a special situation where I need this to happen.
>>>
>>>TIA,
>>>
>>>James
>>
>>Why can't you expicitly call command which is behind the menu bar item?
>
>Here is my situation. I am trying to run a utility program from a form that calls a routine that closes down any open screens to ensure all tables are closed before the utility runs. I can run this utility from the menu and all the forms shutdown properly. If I run it from the form, the form I run it from closes down, but no other open forms will close. Maybe this is not possible, but I thought I would try to see if there is a way to accomplish this. Now that I think about it, I don't think running the menu item code from the form would work either. Probably would be the same situation. Then you may say, since the utility shuts down the forms from the menu, then don't put it on the form. I have a startup form that uses the ctListBar control from dbi-Tech (outlook style bar) and I have utilities under one of the bars and I run the utility from there.
>
>Anyway, bottom line is, the forms will not close when run from the form, but the forms do close when run from the menu.
>
>Any help would be appreciate! Either I am missing something or this is just not possible from a form.
>
>Thanks for any insight you can give me.
>
>James

If you want to run from some form snippet then the first thing a form wants to do is to finish this snippet, i.e. run all utility to the very end and then return from this snippet and only then release. I guess that shortcut way (as Cetin said) will work, but not from snippet again.
BTW, it's not difficult to close tables without closing a form, just issue Form.Dataenvironment.Closetables and when utility finished Form.Dataenvironment.Opentables
Edward Pikman
Independent Consultant
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform