Max, Min, LargeChange, SmallChange, Value Properties

Purpose

Returns or set the minimum, maximum, and the amount of change to the Value property.

Syntax

object.Max [= value% ]

object.Min [= value% ]

object.Value [= value% ]

objects.LargeChange [= value%]

objects.SmallChange [= value%]

object:Scroll, Slider, ProgressBar Ocx
objects:Scroll, Slider Ocx

Description

Min and Max return or set the minimum and maximum for the Value property for the specified control. The Value property returns or sets the current position control. For each property, you can specify an integer between -32,768 and 32,767, inclusive. For all Ocx control types the default setting for Min is 0. For a Scroll control Max = 1000, for a Slider and ProgressBar control Max = 100. But these can be changed.

Slider - The LargeChange property sets the number of ticks the slider will move when you press the PAGEUP or PAGEDOWN keys, or when you click the mouse to the left or right of the slider, default = 20. The SmallChange property sets the number of ticks the slider will move when you press the left or right arrow keys, default = 1.

Scroll - The LargeChange returns or sets the amount of change to the Value property setting in a scroll bar control when the user clicks the area between the scroll box and scroll arrow, default = 100. The SmallChange returns or sets the amount of change to the Value property setting in a scroll bar control when the user clicks a scroll arrow, default = 1.

Example

OpenW Center # 1, , , 400, 200

Me.BackColor = colBtnFace

Ocx Scroll sc1 = "", 10, 10, 370, 20

Ocx ProgressBar pb1 = "", 10, 50, 370, 20

With sc1

.Min = 0 : .Max = 600

.LargeChange = (.Max - .Min) / 10 : .SmallChange = 10

End With

Do

Sleep

Loop Until Me Is Nothing

 

Sub sc1_Scroll()

pb1.Value = (sc1.TrackValue * 10 / 9) / ((sc1.Max - sc1.Min) / 100)

 

Sub sc1_Change()

pb1.Value = (sc1.Value * 10 / 9) / ((sc1.Max - sc1.Min) / 100)

See Also

Scroll, Slider, ProgressBar

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