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

This topic demonstrates how to use the SmartOutlookShortcutBar 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 SmartOutlookShortcutBar in your application, the following steps must be performed:

  1. Add the SmartOutlookShortcutBar control to your form. 

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

using Xceed.SmartUI;

using Xceed.SmartUI.Controls.OutlookShortcutBar; 

SmartOutlookShortcutBar shorcutBar = new SmartOutlookShortcutBar();

this.Controls.Add( shorcutBar );
  1. Double click on the New Group menu or click on the drop down arrow to add the desired number of Group SmartItems. 

To each of these Group SmartItems, you can then added the desired number of Shortcut SmartItems by selecting a group and double clicking on the New Task menu.  

If you want to add items other than Groups and Shortcuts, you can click on the drop down arrow and select the SmartItem to add.  

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

We will start by adding 2 Group SmartItems and then we will add 3 Shortcut SmartItems to the first group. To the second group, we will add a ComboBoxTool SmartItem.

shorcutBar.Items.Add( "First Group" );

shorcutBar.Items.Add( "Second Group" );

( ( Xceed.SmartUI.Controls.OutlookShortcutBar.Group )shorcutBar.Items[ 0 ] ).Expanded = true;

( ( Xceed.SmartUI.Controls.OutlookShortcutBar.Group )shorcutBar.Items[ 1 ] ).Expanded = true; 

shorcutBar.Items[ 0 ].Items.Add( "Task One" );

shorcutBar.Items[ 0 ].Items.Add( "Task Two" );

shorcutBar.Items[ 0 ].Items.Add( "Task Three" );

shorcutBar.Items[ 1 ].Items.Add( new ComboBoxTool( "Combo Tool" ) );
  1. Configure your SmartOutlookShortcutBar.  You can decide if a Group SmartItem is expanded, enabled or visible and you can change its text,  position within the list, etc. You can also configure various properties of each Shortcut SmartItem. 

In the following code, we will collapse the second Group SmartItem and move the last Shortcut SmartItem in the first group to the first position:

( ( Xceed.SmartUI.Controls.OutlookShortcutBar.Group )shorcutBar.Items[ 1 ] ).Expanded = false;

shorcutBar.Items[ 0 ].Items[ shorcutBar.Items[ 0 ].Items.Count - 1 ].Index = 0;
  1. The SmartOutllookShortcutBar SmartControl also allows you to change the position of the text to place it below or to the right of the image. This is done by setting the TextPosition property.

When you run your application, you end up with an Outlook-style shortcut bar:  

Things you should consider