Placement, ScrollOpposite Properties (TabStrip)

Purpose

The Placement property returns or sets a value that specifies the placement of tabs-top, bottom, left, or right.

ScrollOpposite returns or sets a boolean that determines how remaining rows of tabs in front of a selected tab are repositioned.

Syntax

TabStrip.Placement [ = integer ]

TabStrip. ScrollOpposite [ = boolean ]

Description

The Placement property specifies the tabs' location:

0 or 1 - (Default) The tabs appear at the top of the control.

2 - The tabs appears at the bottom of the control.

3 - The tabs appears at the control's left.

4 - The tabs appears at the control's right.

The ScrollOpposite property specifies how the remaining tabs will be repositioned. When False (default), the remaining tabs remain on the same side of the control. When True, The row of tabs in front of the selected tab are repositioned at the opposite side of the control.

ScrollOpposite only works correctly with Style = tabTabs, not with buttons.

Example

OpenW Fixed 1

Global Int32 n, h, w

h = TwipsToPixelY(Win_1.Height) - (2 * Screen.cyFixedFrame) - (Screen.cyCaption)

w = TwipsToPixelX(Win_1.Width) - (2 * Screen.cxFixedFrame) + 1

Ocx TabStrip tbs

tbs.Style = tabTabs

tbs.ScrollOpposite = False

cmd_Click(0)

For n = 1 To 10 : tbs.Add , , "Tab " & n : Next n

Ocx Command cmd(1) = "Top", (w - 60) / 2, (h / 2) - 40, 60, 22

Ocx Command cmd(2) = "Bottom", (w - 60) / 2, (h / 2) + 18, 60, 22

Ocx Command cmd(3) = "Left", (w / 2) - 80, (h - 22) / 2, 60, 22

Ocx Command cmd(4) = "Right", (w / 2) + 20, (h - 22) / 2, 60, 22

Ocx CheckBox chk = "ScrollOpposite", (w - 100) / 2, (h / 2) + 60, 100, 14 : chk.BackColor = RGB(255, 255, 255)

Do : Sleep : Until Me Is Nothing

 

Sub chk_Click

tbs.ScrollOpposite = 1 - chk.Value

EndSub

 

Sub cmd_Click(Index%)

Select Index%

Case 0, 1 : tbs.Move 0, 0, w, 40

Case 2 : tbs.Move 0, h - 40, w, 40

Case 3 : tbs.Move 0, 0, 40, h

Case 4 : tbs.Move w - 40, 0, 40, h

EndSelect

tbs.Placement = Index%

EndSub

Known Issues

ScrollOpposite doesn't seem to work at all,

See Also

TabStrip

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