Tab Object

This object represents an individual tab in the Tabs collection of a TabStrip control.

Syntax

tabstrip.Tab

Parameters

tabstrip
Object expression that evaluates to a TabStrip control.

The Tab object supports the following properties:

Remarks

For each Tab object, you can use various properties to specify its appearance, and you can specify its state with the Selected property.

To insert and remove tabs at design time, use the Insert Tab and Remove Tab buttons on the Tabs tab in the Properties sheet of the TabStrip control. Use the text boxes to specify any of the following properties for a Tab object: Caption, Image, ToolTipText, Tag, Index, or Key. You also can specify these properties at run time.

Use the Caption and Image properties, separately or together, to label a tab or put an icon on a tab.

To use the Caption property to display text on a tab or button, open the Properties sheet of the TabStrip control, type the text you want to appear in the Caption text field.

To use the Image property, put an ImageList control on the form and fill the ListImages collection with ListImage objects, each of which has an index number. On the General tab in the Properties sheet of the TabStrip control, select that ImageList to associate it with the TabStrip control. In the Image text box on the Tabs tab, type the index number or key of the ListImage object that should appear on the Tab object.

Use the ToolTipText property at run time to temporarily display a string of text in a small rectangular box when a user's cursor pauses on the tab. To set the ToolTipText property at design time, select the ShowTips check box on the General tab, and then type the ToolTip string in the ToolTipText text box on the Tabs tab.

To return a reference to a Tab object a user selects, use the SelectedItem property; to determine whether a user selects a specific tab, use the Selected property. These properties are useful in conjunction with the BeforeClick event to verify or record data associated with the currently selected tab before displaying the next tab the user selects.

Each Tab object has the following read-only properties you can use to reference a single Tab object in the Tabs collection: Left, Top, Height and Width.