TabWidthStyle

This property returns and sets a value that determines the justification or width of all Tab objects in a TabStrip control.

Syntax

object.TabWidthStyle [= value]

Parameters

object
Object expression that evaluates to a TabStrip control.
value
Integer or constant that determines whether tabs are justified or set to a fixed width. Following are the settings for value:
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.

The following code example shows how to set the TabWidthStyle property at run time.

' Justifies all the tabs in a row to fit the width of the control.
    TabStrip1.MultiRow = True
    TabStrip1.TabWidthStyle = 0 ' tabJustified
' Creates ragged rows of tabs.
    TabStrip1.MultiRow = True
    TabStrip1.TabWidthStyle = 1 ' tabNonJustified
' Sets the same width for all tabs.
    TabStrip1.TabFixedWidth = 500
    TabStrip1.TabWidthStyle = 2 ' tabFixed