Xceed SmartUI for WinForms v3.6 Documentation
Using the SmartToolBar SmartControl
Welcome to Xceed SmartUI for WinForms v3.6 > Basic Concepts > SmartControls > SmartToolBar > Using the SmartToolBar SmartControl

This topic demonstrates how to use the SmartToolBar SmartControl using both the designer and code. The code is provided in a sequential order and can be cut and pasted into your application step-by-step.

Basic steps

To use the SmartToolBar in your application, the following steps must be performed:

  1. Add the SmartToolBar control to your form.

 

If you would prefer to add the SmartToolBar SmartControl to your form programmatically, the following code can be used:

using Xceed.SmartUI;

using Xceed.SmartUI.Controls.ToolBar; 

SmartToolBar bar = new SmartToolBar();

this.Controls.Add( bar );
  1. Double click on the New Tool menu or click on the drop down arrow to add Tool SmartItems. 

If you want to add items other than Tools, you can click on the drop down arrow and select the SmartItem to add. The first eight SmartItems in the list are the preferred SmartItems for the SmartToolBar.

 

 

To add SmartItems programmatically to the SmartToolBar , you can use the following code: 

The first two items to be added will be the Tool and ComboBoxTool SmartItems. The last item will be a ProgressPanel.

bar.Items.Add( "first tool" );

bar.Items.Add( new ComboBoxTool( "Select:" ) ); 

bar.Items.Add( new ProgressPanel() );

Configure your SmartToolBar.  You can decide if the SmartItems are enabled or visible and you can change the text, position, etc.   

When you run your application, you end up with an XP-style toolbar quite similar to the one found throughout Windows: 

Things you should consider