Control - UpDown

images\btn_ctrl_updown.gif Insert an increment/decrement control, also called spin buttons.

 

UpDown controls are most often used with another control, such as a Text Box, which is known as the buddy control of the UpDown. [For non-English speakers: a "buddy" is slang for a "friend."]

 

In addition to the properties listed below, a Control tab provides access to certain frequently used form properties for this control. See the Form Properties topic for information on those properties.

 

 

UpDown

General

 

Alignment

AlignmentLeft - Place on left side of buddy control. AlignmentRight - Place on right side of buddy control.

Orientation

OrientationVertical - Arrows point up/down. OrientationHorizontal - Arrows point left/right.

OLEDropMode

Set to None (default) if the UpDown does not accept OLE drops and is to display the No Drop cursor if an OLE drop is attempted. Set to Manual, the UpDown will trigger OLE drop events, allowing programs to handle the OLE drop operation in code.

 

 

Buddy

 

Buddy Control

Variant value that specifies the buddy control.

AutoBuddy

True - Automatically use previous control in tab order as buddy control.

SyncBuddy

True - UpDown synchronizes the Value property with the designated property (set in BuddyProperty) of the buddy control. False (Default) - no synchronization of Value with a property in the buddy control.

BuddyProperty

Property in buddy control to synchronize to the Value property of the UpDown. If no property is specified and SyncBuddy is True, then the default property of the buddy control is used.

 

 

Scrolling

 

Value

Long integer specifying current value, incremented or decremented by up and down arrows.

Min

Minimum value returned by the UpDown.

Max

Maximum value returned by the UpDown.

Wrap

True - wrap the value when user reaches the min or max value. False (Default) - don't wrap around.

Increment

The amount by which Value changes with each click of the up or down arrow. Default = 1.

 

Max is normally greater than Min. The up arrow always moves Value in the direction of Max and the down arrow always towards Min. Both can be negative numbers. If Max can be less than Min (very weird and asking for conceptual errors - not a good idea).

 

Note: Some texts on VB (including, surprisingly, MDSN) say that we cannot use the windowless, lightweight form of controls as a buddy control for the UpDown. That's not true, as wlTextBox, for example works fine with the UpDown both within Visual Basic and Manifold Visual Basic Scripting forms. Should Microsoft ever change this control in future releases so that windowless controls cannot be buddies, one could always simply use the UpClick and DownClick events generated by the UpDown to change the value in the text box.