Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Shortcutmenu
Message
From
12/05/2016 18:02:03
 
 
To
12/05/2016 16:36:44
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Application:
Desktop
Miscellaneous
Thread ID:
01636289
Message ID:
01636300
Views:
53
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform