Nevron Open Vision Documentation
User Interface / Widgets / Ribbon / Ribbon Tab
In This Topic
    Ribbon Tab
    In This Topic

    The ribbon tab is the main part of a NOV ribbon. It is accessible through the Tab property of the ribbon and contains its tab pages, the application menu, the ribbon collapse button and the ribbon's top right content. The ribbon tab can be either in expanded or in collapsed state, which can be controlled through the Expanded property. When the ribbon tab is in expanded state, the content of the currently selected tab page is shown and when it is in collapsed state, only the tab page headers are shown.

     Tab Pages

    The TabPages property of the ribbon tab can be used to add/remove tab pages. Each tab page contains a collection of ribbon groups and plays very important role in the ribbon layout algorithm. The following code demonstrates how to add several tab pages to a ribbon tab:

    Adding of pages to a ribbon tab
    Copy Code
    ribbon.Tab.TabPages.Add(new NRibbonTabPage("Home"));
    ribbon.Tab.TabPages.Add(new NRibbonTabPage("Insert"));
    ribbon.Tab.TabPages.Add(new NRibbonTabPage("View"));
    

    At any given time one of the pages of the ribbon can be selected, which means that the ribbon will show its content to the user. The currently selected ribbon tab page can be controlled through the SelectedIndex property of the ribbon tab or through the SelectedPage property. When the currently selected ribbon tab page changes, the SelectedIndexChanged event is fired.

    By default the page headers of the ribbon tab are placed next to each other, but if necessary some spacing can be set between them through the HeadersSpacing property.

     Ribbon Search Box

    Optionally you can create and set a ribbon search box to the SearchBox property of a NOV ribbon tab. The ribbon search box is an auto complete box that lets the user quickly find and launch ribbon commands by entering some letters from the keyboard.

    When the ribbon content is fully created and added to the ribbon, you should call the InitFromRibbon method of the ribbon search box to make it populate its auto complete list from the buttons of the ribbon:

    Creating and Initializing a Ribbon Search Box
    Copy Code
    ribbon.Tab.SearchBox = new NRibbonSearchBox();
    ribbon.Tab.SearchBox.InitFromRibbon();
    
     Collapse Button
    The collapse button of the ribbon tab is placed at the top right side of the ribbon, after the tab page headers. It is accessible through the CollapseButton property of the ribbon tab. When clicked the collapse button automatically toggles the value of the ribbon tab's ExpandedProperty, which causes it to expand/collapse.
     Additional Content

    The additional content of the ribbon tab, is placed at its top right side, next to the collapse button. It can be any widget, but most commonly is a help button. The following line of code can be used to add a default help button as an additional content:

    Default Help Button
    Copy Code
    ribbon.Tab.AdditionalContent = new NRibbonHelpButton();
    

    The default image of the ribbon help button is white question mark in a blue circle with size 16x16 pixels. It can be changed through the Image property.

    See Also