We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to create and set up CommandBars

Platform: WinForms |
Control: CommandBarController


When using the Windows Forms designer, CommandBars are created only through an instance of the CommandBarController class and never directly. The following sequence highlights the steps involved in creating and initializing the CommandBars:

1. Select the CommandBarController item from the Visual Studio.NET toolbox and add the component to the design form’s component tray.

2. Using either the CommandBarController’s AddCommandBar and RemoveCommandBar design-time verbs or the CommandBarController.CommandBars property collection editor, add the required CommandBars to the form.

3. Select each CommandBar in turn and using the property browser set its Appearance and Behavior attributes to achieve the desired visual effect and behavior. Please refer to the Essential Tools User’s Guide and Class Reference documentation for detailed information on how each of these properties affect the CommandBar.

4. Set the Layout attributes for each of the CommandBars. Layout attributes control the CommandBar bounds. Set the CommandBar’s MaxLength property to be equal to the width of the client control and the MinHeight property to be equal to the client’s height.

5. Select the client controls and drag-and-drop them onto the client region of the CommandBars. This adds the selected control to the respective CommandBar’s controls collection and resizes it to fit the CommandBar’s client bounds.

6. CommandBars can now be dragged around and docked/floated at the final location. The CommandBar position information is persisted by the designer and applied when the application is loaded.

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile