TabFixedHeight, TabFixedWidth, TabWidthStyle, TabMinWidth Properties (TabStrip)

Purpose

Return or set the fixed height and width of all Tab objects in a TabStrip control, but only if the TabWidthStyle property is set to tabFixed.

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

The TabMinWidth property returns or sets the minimum allowable width of a tab.

Syntax

TabStrip.TabFixedHeight [= integer]

TabStrip.TabFixedWidth [= integer]

TabStrip.TabWidthStyle [ = integer]

TabStrip.TabMinWidth [= integer]

Description

The TabFixedHeight and TabFixedWidth properties specify the number of pixels or twips of the height or width of a TabStrip control. The scale used for integer is dependent on the ScaleMode of the container.

The TabFixedHeight property applies to all Tab objects in the TabStrip control. It defaults either to the height of the font as specified in the Font property, or the height of the ListImage object specified by the Image property, whichever is higher, plus a few extra pixels as a border. If the TabWidthStyle property is set to tabFixed, and the value of the TabFixedWidth property is set, the width of each Tab object remains the same whether you add or delete Tab objects in the control.

The TabWidthStyle property determines whether tabs are justified or set to a fixed width, it can take the following values:

tabJustified (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.
tabNonJustified (1) Non-justified. Each tab is just wide enough to accommodate its contents. The rows are not justified, so multiple rows of tabs are jagged.
tabFixed (2) Fixed. All tabs have an identical width, which is determined by the TabFixedWidth property.

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

The TabMinWidth property specifies the minimum width of a Tab object. The scale used for number is determined by the ScaleMode property of the container. The TabMinWidth property has no effect if the TabWidthStyle property is set to tabFixed.

Example

Ocx TabStrip ts(1) = "", 10, 10, 700, 110 : ts(1).MultiRow = True : ts(1).TabWidthStyle = tabJustified

Ocx TabStrip ts(2) = "", 10, 140, 700, 110 : ts(2).MultiRow = True : ts(2).TabWidthStyle = tabNonJustified

Ocx TabStrip ts(3) = "", 10, 270, 700, 40 : ts(3).TabWidthStyle = tabFixed : ts(3).TabFixedWidth = 90

Ocx TabStrip ts(4) = "", 10, 330, 700, 40 : ts(4).TabWidthStyle = tabFixed : ts(4).TabFixedWidth = 120 : ts(4).TabFixedHeight = 35

Ocx TabStrip ts(5) = "", 10, 390, 700, 40 : ts(5).TabMinWidth = 50

Local Int32 m, n

For m = 1 To 5

For n = 1 To 40

If Odd(n) Then ts(m).Add , , "Tab" & n

If Even(n) Then ts(m).Add , , "Tab" & n & " (Even)"

Next n

Next m

Do : Sleep : Until Me Is Nothing

See Also

TabStrip

{Created by Sjouke Hamstra; Last updated: 24/10/2014 by James Gaite}