[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
  [Expand]Data Grid
  [Collapse]Ribbon, Bars and Menu
   [Expand]Common Features
    [Expand]Getting Started
    [Collapse]Bar Layout
      Bar Manager
      Standalone Bar Controls
      Bar Containers
    [Expand]Populating Bars
     Bar Actions
    [Expand]Runtime Customization
     Saving and Restoring a Bar Layout
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)


Bars are containers of commands, sub-menus, static text, editors, etc.

Unlike Standalone Bar Controls, Bars cannot be used separately and require a parent Bar Manager component. Bar Managers store their child bars in the Bar object collections.

Expanded Bar Types

Depending on the Bar.IsMainMenu and Bar.IsStatusBar property values, bars are considered as either main menu bars, status bars or regular toolbars.

Main menu and status bars have the following features:

  • cannot be hidden or moved by an end-user at runtime;
  • always occupy the entire row (see the Bar.UseWholeRow property);
  • painted in a different manner than other bars.

Main menu bars receive focus when an end-user presses the ALT key.

Expanded Populating Bars

A bar can be populated with either links to existing bar items (use the BarItemLinkHolderBase.ItemLinks collection to do that), or directly with new bar items (the BarItemLinkHolderBase.Items collection). In the latter case, a Bar Manager will automatically generate a bar item link for each bar item added.

The following example creates two Bar objects, named "Edit" and "Main", which are docked to the right and top of the window respectively. A single element of the Main toolbar is a sub-menu whose elements are bar item links (these bar item links refer to bar items declared in other locations). The Edit toolbar displays three bar items (Cut, Copy and Paste) and one bar item link that refers to the btnFormatPainter item declared in the BarManager.Items collection.

Expanded Arranging Bars

Bar objects can be docked to the window, or they can be floating. To allow bars to be docked to the window, you need to add BarContainerControl objects to the window, as bars can only be docked to these containers. BarContainerControls can be created either implicitly by enabling the BarManager.CreateStandardLayout option or manually. After bar containers have been created, a bar can be docked to the target container using the Bar.DockInfo property. See Bar Containers to learn more.

If you want to create a floating bar, set the Bar.DockInfo.ContainerType (BarDockInfo.ContainerType) property to BarContainerType.Floating. There is no need to manually create floating bar containers.

Expanded Examples

Is this topic helpful?​​​​​​​