Quick Find: Search for:

 Total Access Components
Control Tour

Return to Components Home
 

 
 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

About Box

AVI (Video)

Bitmap Effects

Border
Browse for Folder New!
CD Player
Clipboard
Clock
Common Dialogs
Date Time Picker New!
Digital Display
Enhanced Button
Gauge
Icon Menu
INI File
Marquee
Notes
Popup Menu
Progress Meter
Registry
Resize
Slider
Spin Button
Splitter
System Info
Tab Strip
Text Effects
Timer
Wave
 

 

Total Access Components Tour: Spin Button

The Spin Button control is a databound control that is used to increment or decrement a numeric value by clicking on or holding the mouse button down over the control’s “up” or “down” button. It is commonly used in Windows applications in conjunction with a text box containing a numeric value.

Using the Spin Button control

There are three basic steps for using the Spin Button control:

Step 1: Associate the Spin Button control to another control

This is usually a text box, but it can be any control that displays a numeric or date value to reflect the value when the user presses the spin buttons.

Step 2: Modify the Spin Button control’s properties

Open the spin button control’s property sheet by right-clicking on the control, selecting FMS Spin Control Object, and choosing Properties. The Min and Max properties should always be set to the lower and upper limits of the input required. To use the control to increment or decrement a value, the LargeChange and SmallChange properties should be set to values which are applied to another control when the OnSpin event occurs. To allow the spin control’s OnSpin event to fire repeatedly while depressing either of its buttons, check the AutoIncrement property. The RollOver property allows the spin control’s value to cycle (reset to the Min or Max value if you try to “go past” them).

Step 3: Write code for changes to the Spin control’s value

For the spin button control’s OnSpin event, write code to change the associated control’s value by substituting the spin control’s Value property, or by adding/subtracting the spin control’s LargeChange or SmallChange property values to/from the value in the associated control.

Spin Button Properties

Name

Description

AutoIncrement

The AutoIncrement property determines if the Value property is automatically updated when the user changes the control through the user interface.

ArrowStyle

The display style of the arrow.

BackColor

The background color of the control.

Enabled

The Enabled property determines if the user can modify the control.

ForeColor

The foreground color of the control.

HighlightColor

The highlight color of the arrow.

LargeChange

The value the slider changes when a large change event occurs.

Max

The maximum value.

Min

The minimum value.

Orientation

The control’s orientation.

RollOver

The RollOver property determines if the value resets to the minimum when it exceeds the maximum, or to the maximum when it goes below the minimum.

ShadowColor

The color of the shadow.

SmallChange

The value of the slider changes when a small change event occurs.

Value Default Databound

The value of the control.

Spin Button Events

Name

Description

Click

Fires when the mouse is clicked over the control.

DblClick

Fires when the mouse is double clicked over the control.

KeyDown

Fires when a key is depressed.

KeyPress

Fires when a key is pressed.

KeyUp

Fires when a key is released.

MouseDown

Fires when a mouse button is depressed over a control.

MouseMove

Fires when the mouse moves over the control.

MouseUp

Fires when a mouse button is released over a control.

OnChange

Fires when the user changes the value of the control.

OnSpin

Fires when the user clicks the up or down button.

Contact Us  l   Web questions: Webmaster   l   Copyright © 2008 FMS, Inc.

Celebrating 22 Years of Software Excellence