Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Collapse]Ribbon, Bars and Menu
   [Collapse]Bars
    [Collapse]Tutorials
      Add and Remove Toolbars
      Add Bar Items To Toolbars
      Bar Item Links
      Provide Functionality to Bar Items
      Toolbar Customization
      Recently Used Items
      Create Popup Menus
     MDI Merging
    [Expand]Bar Manager Designer
    [Expand]Runtime Customization and Layout Management
    [Expand]Appearance and Hotkeys
   [Expand]Ribbon
   [Expand]Popup Menus
    Radial Menu
   [Expand]Common Features
   [Expand]Examples
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [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]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Add and Remove Toolbars

This document describes existing toolbar types and how to add them.

Expanded Initial Setup

  • Locate the BarManager component in the VS Toolbox and drop it onto the form. The Bar Manager is the core component of the DevExpress Bars library and provides centralized access to all toolbars, menus and items.
  • The BarManager automatically creates three toolbars - main menu, regular toolbar and status bar.

    All three toolbars are objects of the same Bar class, but nevertheless feature severe differences in appearance and behavior.

    • Main menu. A Bar assigned to the bar manager's BarManager.MainMenu property. This bar contains buttons with no images. Each button is a category (e.g., 'File', 'Edit', 'Format') that displays other buttons and sub-items on clicking. This bar has the following specifics:
      • it cannot be hidden by an end-user at runtime;
      • it's stretched by default horizontally to fit the container's width (see the BarOptions.UseWholeRow property);
      • the item multi-line arrangement feature is enabled by default (see the BarOptions.MultiLine property);
      • receives focus when an end-user presses the ALT key;
      • if it belongs to an MDI child window, it is automatically merged with the parent MDI form's main menu.

    • Status bar. A Bar assigned to the manager's BarManager.StatusBar property. Designed to display status application info; provides the following specific features:

    • Regular toolbar. A Bar that contains buttons and editors that represent the most frequently used actions (e.g., creating new documents, font settings or text alignment). Buttons within such bars usually display their icons only. Can occupy multiple lines (see the BarOptions.MultiLine property) or less than one (see the BarOptions.UseWholeRow property).

Expanded Add and Remove Toolbars

To remove a bar, first click it at design-time. The selected bar will become highlighted.

Press the "DELETE" key to remove the selected bar.

To add a bar, invoke the BarManager's smart tag and click "Create Toolbar".

Another way to add a toolbar is to invoke the BarManager component's smart tag and click "Customize". This will invoke the Customization Window dialog where you can add and remove toolbars, as well as reset their settings to default values.

The added Bar will be a regular toolbar, docked below other toolbars of this type. You can instantly re-arrange bars by dragging them at design time.

Expanded Code Sample

Expanded See Also

Next tutorial: Add Bar Items To Toolbars
How would you rate this topic?​​​​​​​