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
310
Use the Ribbon with CAB SCSF
posted

Hi I am having a look at the source code of Infragistics.CompositeUI.WinForms and I am able to dynamically add/remove:

  • Tabs on a Ribbon bar
  • Groups on a Tab of a Ribbon
  • ToolBase on a Group of a Ribbon

by using the UI Extensions provided by you guys. What I can't really do, or maybe I don't know how to do it, is to add items on the menu of the Ribbon, you know the menu that appears when you click the big circle on the Ribbon?

How I can do that, what is the controls that hold the toolbase controls in that menu? I didn't find any example for that.

  • 2077
    Offline posted

    The UIExtensionSite is Ribbon.ApplicationMenu.ToolAreaLeft.Tools.

    You have to register this extesion site:

    RootWorkItem.UIExtensionSites.RegisterSite("ApplicationMenu", Shell.Ribbon.ApplicationMenu.ToolAreaLeft.Tools);

    Then you can add ButtonTools in your modules:

    ButtonTool testButton = new ButtonTool("Test");
    testButton.SharedProps.Caption = "Test!";
    testButton = WorkItem.UIExtensionSites["ApplicationMenu"].Add(testButton);
    WorkItem.Commands["Test"].AddInvoker(testButton, "ToolClick");

    Then you add the command handler:

    [CommandHandler("SyncNow")]
    public void OnSyncNow(object sender, EventArgs eventArgs)
    {
        MessageBox.Show("Test!");
    }

    Hope this helps!

    Emanuel

  • 310
    posted

    Is there anybody that can help me with this?