[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Collapse]Build an Application
  [Collapse]Choose Application UI
   [Expand]Office Inspired UI
   [Collapse]Visual Studio Inspired UI
     Step 1 - Document Manager
     Step 2 - Dock Manager
     Step 3 - Bar Manager
   [Expand]Windows Modern UI
    Touch-Enabled Tile UI
    Fluent Design UI
    Data Management Controls
  [Expand]Printing and Exporting
  [Expand]WinForms MVVM
  [Expand]Right-to-Left Layout
   Redistribution and Deployment
   How to: Perform Actions On Application Startup
 [Expand]Controls and Libraries
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[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)

Step 3 - Bar Manager

In this step, you will add a Bar Manager component to your application and learn how to interact with DocumentManager and DockManager items via BarItems. You may want to replace a Bar Manager with a Ribbon Control. All of the instructions below are suitable for the Ribbon Control as well. However, in this step the Bar Manager control is used, as it is more appropriate for the Visual Studio application UI.

  1. Locate the Bar Manager component in your toolbox and drop it onto the form.

  2. Once you add the Bar Manager control, three bars are created automatically. These bars represent the main menu, status bar and regular toolbar. Technically, these bars are the same Bar objects that can display BarItemLinks, but the main menu bar and status bar are assigned to the BarManager.MainMenu and BarManager.StatusBar properties, respectively. The following image illustrates these bars (a BarStaticItem was added to each bar for visualization purposes).

    To add new bars, use the corresponding link in the Bar Manager smart tag.

    To delete an existing bar, select it at design time and press 'Delete', or click the corresponding button in the Bar Manager Designer. For this example we will only need the main menu and status bar, so the regular bar can be deleted.

  3. Bars display BarItemLink objects - links to BarItems. To add a BarItem to a desired Bar, click the 'Add' button and select the required BarItem type. Add a BarSubItem to your main menu Bar.

    You can right-click an item to customize it. For example, choose a style that specifies whether only an item caption, item glyph or both caption and glyph should be displayed. To specify this style in code use the BarItemLink.PaintStyle property.

    By default, items within regular toolbars only display icons, and items within the main menu only display captions.

  4. The BarStaticItem that you added in the previous step is a submenu that can contain other items. To add a BarItem to a BarStaticItem, select the BarStaticItem and click the Add button (using the same approach you used when adding items to a Bar). Add the New BarButtonItem to the File submenu. This button will add a new Document to your application. Refer to the Documents topic to see an example of adding Documents to a DocumentManager at runtime.
  5. Add a BarDockingMenuItem to your main menu. This unique item allows you to manage both DockPanels and Documents contained in your application.

The animation below shows the approximate results of completing the steps above.

To learn more about the controls used in this tutorial, refer to the following help topics.

Expanded See Also

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