Back to Devexpress

Runtime Customization

windowsforms-117515-controls-and-libraries-ribbon-bars-and-menu-bars-runtime-customization-and-layout-management-runtime-customization.md

latest7.3 KB
Original Source

Runtime Customization

  • Jan 14, 2025
  • 4 minutes to read

This document explains what layout customization actions your end-users can perform and how, and what options you have to regulate these modifications.

Add and Customize Toolbars

End-users can add new toolbars and customize existing ones only by using the Customization Window dialog. To invoke this dialog, a user must do one of the following.

  • Right-click a toolbar and select “Customize…”.

  • Click a toolbar’s Quick Customization button and select “Add or Remove Buttons | Customize…”.

In the “Toolbars” tab of the Customization Window, end-users can click corresponding buttons to create, rename, delete and reset toolbars. Check boxes next to toolbar names to specify these toolbars’ visibility.

To prevent end-users from making these changes to a layout of toolbars, use the following API.

|

Property

|

Description

| | --- | --- | |

BarManager.AllowCustomization

|

Gets or sets whether or not end-users can invoke the Customization Window dialog.

| |

BarManager.AllowShowToolbarsPopup

|

Utilize this property to disable context menus shown on right-clicking toolbars.

| |

BarManager.AllowQuickCustomization

BarOptions.AllowQuickCustomization

|

Disable these properties to hide Quick Customization buttons for all toolbars owned by this Bar Manager, or for specific toolbars only.

| |

BarOptions.AllowDelete

|

Specifies whether or not end-users can permanently remove this toolbar. By default, this option is enabled only for toolbars created by users at runtime.

| |

BarOptions.AllowRename

|

Gets or sets whether or not end-users can rename this toolbar.

| |

BarOptions.DisableClose

|

Gets or sets whether the user can hide the bar with the Customization Window or the ‘X’ button.

|

Drag-and-Drop Toolbars

By default, all toolbars except for a status bar display a drag border.

End-users can drag these borders to re-arrange toolbars, dock them to screen edges and make them floating.

The following API manages the availability of drag-and-drop features.

PropertyDescription
BarOptions.DrawDragBorderIf this property is disabled, a bar will not show its drag border and as a result, end-users will be unable to drag this toolbar.
Bar.CanDockStyleEnumerates all possible positions a toolbar can occupy. End-users are unable to dock this toolbar to other locations.
BarManager.AllowMoveBarOnToolbarIf this property is disabled, end-users will be unable to move toolbars along their parent BarDockControl containers. All toolbars that do not occupy the entire row (see the BarOptions.UseWholeRow property) will stick together in a solid line without gaps.

End-users can complete the following link operations at runtime.

  • Hide existing bar item links and show them again using the Quick Customization button.
  • Drag items from the “Commands” tab of the Customization Window dialog to toolbars, sub-menus and popup menus. By doing so, end-users create links to these bar items. For end-users’ convenience, you can organize bar item into categories.
  • Drag item links away from toolbars and menus. To be able to drag a link, an end-user must either hold the ALT key, or have the Customization Window dialog opened. If a user drops a link outside toolbars and sub-menus, the link is removed, otherwise - moved to this new location. A user can also hold the CTRL key to copy this link to a desired position.
  • Right-click a link to be able to modify its caption and display settings. Link context menus are available only while the Customization Window dialog is active.

To disable required drag-and-drop features, utilize the following API.

PropertyDescription
BarManager.AllowShowToolbarsPopupThis property allows you to disable toolbar context menus.
BarOptions.DisableCustomizationPrevents end-users from dragging links to/from this toolbar.
BarItem.VisibilityIf this property is set to OnlyInRuntime, end-users will not see the item within the Customization Window dialog.

Change Global Toolbar Settings

The “Options” tab of the Customization Window dialog allows end-users to modify global behavior and appearance settings, common to all toolbars and item links.

SettingDescription
Always show full menusDisables recently used items if checked.
Show full menus after a short delayIf this option is enabled, non-recently used items are shown after a certain delay. Otherwise, a user has to click the menu expand button to view all menu items.
Reset my usage dataA menu with recently used items automatically updates its MRU list to start displaying menu entries requested by end-users. Clicking this button restores the original MRU list of all menus.
Large iconsIf checked, bar items display 32x32 pixel images.
Show ScreenTips on toolbarsIf checked, bar item links display hints.
Show shortcut keys in ScreenTipsIf checked, hints also display shortcuts assigned to bar item links.
Menu AnimationsAllows you to select the animation effect for expanding and collapsing sub-menus and popup menus.