Value, Increment, Max, Min, Wrap Property (UpDown)

Purpose

Returns or sets the value of an object.

Syntax

UpDown.Value [= Double]

UpDown.Min [= Double ]

UpDown.Max [= Double ]

UpDown.Increment [= Double ]

UpDown.Wrap [= boolean]

Description

The Value property sets or returns the current position of the scroll value. The Value property specifies the current value within the range of the Min and Max properties (default is 0). This property is incremented or decremented when the arrow buttons are clicked.

The Min and Max properties sets or returns the maximum value of the scroll range for the UpDown control. The default value for Min is 0 and for Max is 100. The settings of the Min and Max properties determine whether the value is incremented or decremented when the arrow buttons are clicked. If the Max property is less than the Min property, the UpDown control operates in the reverse direction. Pressing the up or right arrow always causes the Value property to approach the Max value. Pressing the down or left arrow always causes the Value property to approach the Min value.

The Wrap property sets or returns a value that determines whether the control's Value property wraps around to the beginning or end once it reaches the Max or Min value.

The Increment property determines the amount the Value property changes when you click the arrow buttons on the UpDown control. The default value is 1. Clicking the up or right arrow, causes Value to approach the Max property by the amount specified by the Increment property. Clicking the down or left arrow, causes Value to approach the Min property by the amount specified by the Increment property.

Example

Ocx TextBox tb = "", 10, 10, 45, 15 : .BorderStyle = 1 : .ReadOnly = True

Ocx UpDown up : .BuddyControl = tb  : .Min = -3 : .Max = 10 : .Increment = 3 : .Wrap = True : .Value = 4

Ocx Label lbl = "up.Value = 4", 10, 40, 100, 14

Do : Sleep : Until Me Is Nothing

 

Sub up_Change

lbl.Text = "up.Value = " & up.Value

EndSub

See Also

UpDown

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