I'm looking for a way to "click" a menuitem programmatically.
I defined a named menu with items and action-blocks and uses it in my mdi-form. I scanned the menu and build a cOutlineListBox from the menu-tree. Clicking a list-box item should trigger the menuitem. Any ideas?
- Founder/Site Admin
- Posts: 484
- Joined: 24 Feb 2017, 09:12
- Location: Gouda, The Netherlands
You mean to automatically pop up the menu? Or automatically execute the actions of a menu item?
When it is the latter, I would implement a different approach. The menu actions should not be coded in the menu item actions, but execute functionality which can be called from outside the menu.
For instance, the menu item could send a msg to the active form which then has the code to execute the actions.
Or call a function (globally or locally) which has the actions.
When that is the case, you can execute the actions without having a menu at all, just send the message or call the function you need from everywhere.
I was thinking about this approch. But even if there is a function-call with parameter in the action-block I cannot scan it and use it in my listbox-menu.
The only thing I get via "vismenu.." is the text and the handle of the item. Maybe the only way is to create both menus from xml-Data dynamicly.
My aim is to have a listbox-menu with the same entries like the MDI or Form-Menu.
Who is online
Users browsing this forum: Ccbot [Crawler] and 0 guests