Skip to main content
A newer version of this page is available. .

Runtime Customization

  • 3 minutes to read

The RibbonControl supports runtime customization options similar to those found in Office 2010.

While an application containing a RibbonControl is running, right-click on free space within the Ribbon Control. Select the Customize Ribbon item from the context menu.

Ribbon Customization Menu

To specify whether or not an end-user will be able to customize a RibbonControl, use the RibbonControl.AllowCustomization property.

The Ribbon customization window has a ListBox that contains commands (BarItems) on the left and a ListBox that contains tabs (RibbonPages) on the right. Notice that custom pages and page groups have ‘(Custom)’ after their title. The ComboBox filter at the top of the left ListBox allows you to choose whether only commands or the full tab hierarchy should be displayed. The following figure illustrates the Ribbon Customization Window.

Ribbon Customization Window

This customization window itself can also be customized using the RibbonControl.OptionsCustomizationForm property. This property provides access to settings that affect window appearance and behavior. The FormIcon property is an appearance property that allows you to assign a custom icon for the customization window. The AllowEditBarItemPopups and AllowLinkCustomization are properties that change end-user edit permissions. The first property specifies whether or not end-users are allowed to customize bar item popups. For instance, if this property is set to true, drop-down button menus (see the BarButtonItem.DropDownControl property) can be customized at runtime. The AllowLinkCustomization property in its turn can allow your end-users to display or hide specific bar item links. If the link is in a custom RibbonPageGroup created by an end-user, it can also be renamed.

Below is a list of operations available by default through the Ribbon Customization feature.

Task

Actions

Add new pages

Click the ‘New’ button and select the ‘New Tab’ option.

Add new groups

Select the desired page within the right ListBox, click the ‘New’ button and select the ‘New Group’ option.

Hide pages and page groups

Select the desired page or page group within the right ListBox and click the left arrow button (Ribbon Customization Left Arrow).

Rename pages and page groups

Select the desired element and click the ‘Rename’ button.

Add commands to custom page groups

Select a group within the right ListBox and a command to be added within the left ListBox, and drag-and-drop or click the right arrow button (Ribbon Customization Right Arrow).

Note: adding commands to the original page groups is not allowed by default.

Re-arrange pages and page groups

Select the desired element and drag-and-drop it to the required position or click the up or down arrow button (Ribbon Customization Up Arrow, Ribbon Customization Down Arrow).

Import/Export your custom layout

Click the ‘Import/Export’ button and select the desired option.

Restore the original layout

Click the ‘Reset’ button and choose to either reset the selected RibbonPage or the entire RibbonControl layout. In the latter case, the layout will be immediately restored without clicking the ‘Apply’ button.

For more information, see RibbonControl.SetCurrentLayoutAsDefault.

The RibbonControl supports the layout auto-save feature. If an end-user did not manually save the customized layout, it can be auto-saved on closing the parent form (see the RibbonControl.AutoSaveLayoutToXml property to learn more). The next time the application starts, this layout will be automatically restored from an XML file.