TabWidthStyle

Returns or sets a value that determines the justification or width of all Tab objects in a TabStrip control.

Syntax

object.TabWidthStyle [=value]

The TabWidthStyle property syntax has these parts:

Part Description
object An object expression that evaluates to an object.
value An integer or constant that determines whether tabs are justified or set to a fixed width, as described in Settings.

Settings

The settings for value are:

Value Description
0 (Default) Justified. If the MultiRow property is set to True, each tab is wide enough to accommodate its contents and, if needed, the width of each tab is increased so that each row of tabs spans the width of the control. If the MultiRow property is set to False, or if there is only a single row of tabs, this setting has no effect.
1 Nonjustified. Each tab is just wide enough to accommodate its contents. The rows are not justified, so multiple rows of tabs are jagged.
2 Fixed. All tabs have an identical width, which is determined by the TabFixedWidth property.

Remarks

At design time you can set the TabWidthStyle property on the General tab of the Properties Page of the TabStrip control. The setting of the TabWidthStyle property affects how wide each Tab object appears at run time.

At run time, you can set the TabWidthStyle property as follows:

' Justifies all the tabs in a row to fit the width of the control.
TabStrip1.MultiRow = True
TabStrip1.TabWidthStyle = tabJustified

' Creates ragged rows of tabs.
TabStrip1.MultiRow = True
TabStrip1.TabWidthStyle = tabNonJustified

' Sets the same width for all tabs.
TabStrip1.TabFixedWidth = 500
TabStrip1.TabWidthStyle = tabFixed