VScMax, VScMin, VScPos, VScPage, VScStep, VScTrack Properties

Purpose

Sets and returns the vertical scrollbar values for a Form.

Syntax

Form.VScMax [ = value ]

Form.VScMin [ = value ]

Form.VScPos [ = value ]

Form.VScPage [ = value ]

Form.VScStep [ = value ]

Form.VScTrack [ = value ]

value : Long exp

Description

Properties used to set the vertical scrollbar of a Form object.

VScPos is the value of the control, and can range from VScMin to VScMax, inclusive. It designates where the scroll bar button is positioned along the scroll bar.

VScMin is a number specifying the minimum value that the scroll bar can have. This number ranges from 0 to 30,000, but cannot be greater than the maximum value given in VScMax.

VScMax is a number specifying the maximum value that the scroll bar can have. This number ranges from 0 to 30,000. Setting VScMax to 0 makes the scroll bar disappear. To disable the scroll bar but keep it visible use ~EnableScrollBar(hWnd, SB_VERT, ESB_DISABLE_BOTH) and to enable it again use ~EnableScrollBar(hWnd, SB_VERT, ESB_ENABLE_BOTH).

VScStep is a number specifying the increment that the value is adjusted by when the scrollbar arrow is clicked.

VScPage is a number specifying the increment that the value is adjusted by when the page scroll region of a scroll bar is clicked.

VScTrack returns the current position of the scrollbar in the _VScrolling event sub. This sub called only when the thumb is being moved. The _VScroll event sub is called after the scrolling is complete.

Note: If you manually change either VScPos or VScTrack, you MUST adjust the value of the other; if not, the scrollbars will display odd and incorrect behaviour. Also, using the SetFocus method will reset both of these values to zero.

Default values: .VScPos = 0, .VScTrack = 0, .VScMin = 0, .VScStep = 1, VScPage = 100, .VScMax = 1000.

Example

Global Int32 a = 160, b = a / 2, n

Global Int32 ih = (5 * a) + 22 // Height of the actual work area

Global Int32 vh = (2 * a) + b  // Height of visible area within window

OpenW Fixed 1, , , 500, vh + (Screen.cyFixedFrame * 2) + Screen.cyCaption : Win_1.ControlBox = False

For n = 0 To 4 : Ocx Command cmd(n) = "Close Button " & n, 200, ((n * a) + b), 100, 22 : Next n

Me.ScrollBars = basVertical

Me.VScMin = 0

Me.VScStep = b / 2

Me.VScPage = a / 2

Me.VScMax = ih - vh + Me.VScPage // Height of Work Area - Height of Visible Area + VScPage

Do

Sleep

Until Me Is Nothing

 

Sub Win_1_VScroll

For n = 0 To 4 : cmd(n).Top = (((n * a) + b) - Me.VScPos) : Next n

EndSub

 

Sub Win_1_VScrolling

For n = 0 To 4 : cmd(n).Top = (((n * a) + b) - Me.VScTrack) : Next n

EndSub

 

Sub cmd_Click(Index%)

Win_1.Close

EndSub

Remarks

See Also

Form, _HScrolling, _HScroll, HScMax, HScMin, HScPos, HScPage, HScStep, HScTrack, _VScrolling, _VScroll

{Created by Sjouke Hamstra; Last updated: 08/03/2018 by James Gaite}