Ribbon Control
- 4 minutes to read
A Ribbon Control is represented by the RibbonControl class. It represents a visual control that is usually displayed at a window's top edge. The Ribbon Control replaces traditional toolbars and menus with tabbed pages. Each page is split into groups that contain various elements (buttons, sub-menus, in-place editors, galleries, etc.). All these elements are represented by links to bar items.
NOTE
In XAML, a Ribbon
#Ribbon Elements
Visually, the Ribbon Control consists of the following regions.
- Command Region - Displays various bar item links (buttons, sub-menus, in-place editors, galleries, etc.) combined into groups and pages.
- Quick Access Toolbar - Displays frequently used commands. End-users can add commands to this bar at runtime via a context menu.
- Application Button - Used to provide a menu for the application.
In addition, you can create a Ribbon Status Bar at the bottom of the window. This bar is painted to concur with the RibbonControl's look and feel. You can add commands to this status bar, aligning them to the bar's left and right edges.
Structurally, the RibbonControl consists of page categories, which are containers of ribbon pages. There are two types of page categories.
- Default Page Category - It is designed to display default pages, which are typically always visible during application runtime. Unlike a custom category, the default category doesn't support a caption. The default page is never visible, only its contents are displayed. In the image above, the Home and Settings pages belong to the default page category.
- Custom Page Category - This category is designed to implement contextual ribbon pages, which can be temporarily made visible according to some logic. For custom page categories, captions are displayed. In addition, custom page categories and headers of the category's pages are painted in a different manner than the default page headers. See Ribbon Page Categories and Contextual Pages to learn more.
A page category contains pages as children, which are represented as tabs. An end-user can click a tab to access the commands displayed in it.
Ribbon pages consist of page groups. These visually divide all bar item links into logical groups within each tab.
For details on each individual ribbon element, see the corresponding topics:
- Bar Items and Links
- Ribbon Page Group
- Ribbon Page
- Ribbon Page Categories and Contextual Pages
- Ribbon Quick Access Toolbar
#Ribbon Layout
The Ribbon control provides a smart layout that maximally uses available space to display as much information (links, captions, etc.) as possible. For instance, if a page has been stretched and has no place to display all available links, it automatically becomes a drop button, which can display sub-items within a drop down panel.
The ribbon layout isn't customizable. This means that end-users are not allowed to add, remove, replace ribbon elements, etc. The only customizable element is the Quick Access Toolbar. It displays commands (item links) to the important and mostly used features and allows end-users to customize the list of these commands (add, remove, etc.). For more information, see Ribbon Quick Access Toolbar.
#Ribbon Style
The RibbonControl supports different paint styles (Microsoft Office 2007 and Microsoft Office 2010). You can choose a paint style via the RibbonControl.RibbonStyle property. The styles differ in the way the RibbonControl's elements (mainly, the Application Button and Ribbon Page Headers) are painted .
#Examples
- How to: Create a RibbonControl
- How to: Define a default ribbon category with commands
- How to: Define a custom ribbon category
- How to: Define a RibbonStatusBar
- How to: Create an Application Menu
- How to: Create a BarButtonGroup
- How to: Add items to the Quick Access Toolbar
- How to: Add commands to the right of the Ribbon Page headers
- How to: Define an in-ribbon gallery