Dynamically menu selection


In the Menubar from a form I created a MenuItem named ‘InstrumentMenu’ and text ‘Instrument’.
Then when I open the form the submenu for that menuitem are created dynamically from a list and are all set to enable in the EnableMenuItems event from that form.
When I now click on the menu item ‘Instrument’ I see the list that i have created dynamically.

Question : how can I handle the selected submenu items from this menu ?
How can I read the Text of the selected submenu item ?


This is where a custom subclass of menuitem would be useful. You add instances of your custom subclass to the menu you’ve created then you can implement the action event on that subclass and have full access to any of the menu item properties. See either of the examples: WindowMenu or OpenRecent.

Thanks Jason.
I need to look more into those examples. It took a while but i mastered it by examine the examples.
It works fine now.