Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shortcutmenu
Message
De
12/05/2016 18:02:03
 
 
À
12/05/2016 16:36:44
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Application:
Desktop
Divers
Thread ID:
01636289
Message ID:
01636300
Vues:
52
>Hi,
>
>I have this application working with shortcutmenu's to do a specific method on the form. Right now there is coding with public variables:
>public pcSelection
>do shortcut1.mpr
> on the shortcut menu bars yopu will find: in the bar - PROCEDURE and the procedure reads: pcSelection = 'NewList' a.s.o.
>do case
>case pcSelection = "NewList"
>thisform.createnewList()
>endcase
>
>All works well however I would like to get rid of the public-variable's
>do we have an other solution to activate a method on myForm upon selection of a shortcutmenu bar?
>
>Regards,
>
>Koen

You can pass a reference to the form object to the menu:
DO shortcut1.mpr WITH Thisform
In the setup code of the menu, declare the parameter
PARAMETERS toForm AS Form
From then on, the form methods may be called directly as the action triggered by the menu selection (that is, as a command):
ON SELECTION BAR n OF shortcutmenuname toForm.createnewList()
----------------------------------
António Tavares Lopes
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform