-1

I am working on Winforms application. On it I have placed Infragistics UltraToolbarManager.

Now I just wanted the Ribbon on my form ,not the ribbon Tab and File Tab as its the only ribbon control and nothing is there in the File menu. So I just wanted to remove tabs coming along with it as in image below (pointed by red arrow) and leave the ribbon.

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
Wasif Subzwari
  • 199
  • 3
  • 13
  • 1
    It's an integral part of what a ribbon is. To remove it would be quite odd for users. Reconsider your choice of controls. – DonBoitnott Oct 29 '14 at 16:04

1 Answers1

1

You can accomplish this with hiding the application menu and initializing creation filter class that will skip the rendering of the first tab header. More about how to use creation filter.

private void Form1_Load(object sender, EventArgs e)
{
        this.ultraToolbarsManager1.CreationFilter = new MyCustomCreationFilter();
        this.ultraToolbarsManager1.Office2007UICompatibility = false;
        this.ultraToolbarsManager1.Style = Infragistics.Win.UltraWinToolbars.ToolbarStyle.Office2013;
        this.ultraToolbarsManager1.Ribbon.FileMenuStyle = Infragistics.Win.UltraWinToolbars.FileMenuStyle.None;
}

class MyCustomCreationFilter : IUIElementCreationFilter
{
    public void AfterCreateChildElements(UIElement parent)
    {

    }

    public bool BeforeCreateChildElements(UIElement parent)
    {
        if (parent is TabRowUIElement)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
}
ivayle
  • 1,070
  • 10
  • 17