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
45
Is it possible to hide tab-area from ribbon?
posted

Hello!

I am curious if there is a way to hide the tab-area from the ribbon. I have included a manipulated picture to illustrate what I am looking for. In this scenario I have only one tab on the ribbon.

Thank you in advance for any hints or solutions to how I can be able to do this (in code)!

  • 48586
    posted

    Hello,

     

    It is possible if you made a custom implementation of creation filter interface like the following one:

     

    class MyCreation:IUIElementCreationFilter

        {

            #region IUIElementCreationFilter Members

     

            public void AfterCreateChildElements(UIElement parent)

            {

                RibbonTabItemUIElement ribonTab = parent as RibbonTabItemUIElement;

                if (ribonTab != null)

                {

                   ribonTab.Rect = new System.Drawing.Rectangle(0, 0, 0, 0);

                }

            }

     

            public bool BeforeCreateChildElements(UIElement parent)

            {

                return false;

            }

     

            #endregion

        }

     

     

    And in the load event of the form add the following:

    ultraToolbarsManager1.CreationFilter = new MyCreation();

     

    More about creation filter you could find here:

    http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.2/CLR2.0/html/Win_Creation_Filter.html

     

     

    Let me know if you have any further questions.