Click here to Skip to main content
15,887,917 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Is it possible to add a ribbon tab at run time ? I am looking for a similar way of adding tabs like we add buttons runtime to a ribbon split button . Any help would be greatly appreciated.

I am referring to "Windows Ribbon for WinForms, Part 15 – Use Ribbon as External DLL" article <a href="http://web3.codeproject.com/Articles/62524/Windows-Ribbon-for-WinForms-Part-Use-Ribbon-as"></a>[<a href="http://web3.codeproject.com/Articles/62524/Windows-Ribbon-for-WinForms-Part-Use-Ribbon-as" target="_blank" title="New Window">^</a>] 


Thanks/Saurav.


What I have tried:

C#
I tried adding a ribbon tab run time but looks like it just adds to the collection and does not show up in the ribbon.

<pre lang="c#">private void AddTabItem(string strLabel, uint uCmdID)
        {
            try
            {
                RibbonTab tab;
                tab = new RibbonTab(ribbon1, uCmdID);
                tab.Label = strLabel;
                tab.TooltipTitle = strLabel;
            }
            catch (Exception ex)
            {
                string strExcepMsg = ex.Message;
            }
        }


ribbon1 is my ribbon object.

Please advice.
Posted
Updated 10-Nov-16 20:14pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900