Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
220
Merge Menues
posted

Hi, I need to merge in the main menu of the application some menuitems that are specific to a control inside the main form. If this control is visible the menu items must be visible if the control is not instantiated or invisible items in the menu are not available.

What I've tried is to initialize ToolButtons and StateToolButtons in the control, that implements an interface with 2 methods: the first to get the menu and the second to handle menu actions. When the control is visible the Toolbuttons are added to the main UltraToolbarsManager, when is hidden or removed it removes the items from the UltraToolbarsManager. This works fine even if I'm not sure is the best way to handle this. The problem is that I don't know how to manage OptionSets in this scenario: in the examples I found is always the UltraToolbarsManager thar creates the OptionSet but in my Initialization method of the control I don't have a reference to the UltraToolbarsManager; is the main form that performs the merge when it is the time. How can I specify in the control the behavior of my menu items and then merge them to the main form menu when the control is instantiated?

Thanks

Alessandro

Parents
  • 220
    Suggested Answer
    posted

    Oh, I forgot! When I'm tying to handle manually the alternative checked/uncheched of the menu items that are in the logical OptionSet, by setting the Check property but this seems to fire the ToolClick evet again and goes in loop till a stack overflow...

    Regards
    Alessandro

Reply Children
No Data