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

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

  1. Add the SmartTabStrip control to your form.

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

using Xceed.SmartUI;

using Xceed.SmartUI.Controls.TabStrip; 

SmartTabStrip tab = new SmartTabStrip();

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

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

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

The first four items to be added will be the default item (in this case the Tab SmartItem is both the default and the only preferred SmartItem), however the last item to be added is a SmartStatusBar DateTimePanel SmartItem.

tab.Items.Add( "first" );

tab.Items.Add( "second" );

tab.Items.Add( "third" );

tab.Items.Add( "fourth" );

tab.Items.Add( new DateTimePanel() );
  1. Configure your SmartTabStrip.   You can decide if a Tab SmartItem has an image and you can change its text,  position, etc.

 

In the following code, we will add an image to the first Tab SmartItem and move the last SmartItem to the first position:

tab.Items[ 0 ].Image = new Bitmap( @"d:\image.png" );

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

When you run your application, you end up with an Visual Studio-style tab strip: 

Things you should consider