windowsforms-15777-build-an-application-choose-application-ui-visual-studio-inspired-ui-step-3-bar-manager.md
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.
Locate the Bar Manager component in your toolbox and drop it onto the form.
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).
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.
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.
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.
See Also