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

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

  1. Add the SmartOfficeTaskPane control to your form.

     

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

using Xceed.SmartUI;

using Xceed.SmartUI.Controls.OfficeTaskPane; 

SmartOfficeTaskPane officePane = new SmartOfficeTaskPane();

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

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


 

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

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

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

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

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

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

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

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

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

In the following code, we will change position of the last Task in the first group and hide the last Task SmartItem in the second group:

officePane.Items[ 0 ].Items[ officePane.Items[ 0 ].Items.Count - 1 ].Index = 0;

officePane.Items[ 1 ].Items[ 0 ].Visible = false;

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

Things you should consider