mobile databases, mobile forms, and mobile synchronization … where you need to work
Providing Pocket Access, Mobile Database, Windows CE Database, and Windows CE Development Solutions

Tip of the Month (August 2004)

Creating Spin Controls

A "spin" control allows a user to either enter a numeric value or use "+" and "-" buttons to increment/decrement the current value by one. Here's how you can build "spin" controls on your form.

A "spin" control is actually three controls that are working together:

  • There is an edit control that is connected to column of variable you are trying to spin (for example, QUANTITY).

  • There is a Command Button labeled "+" that, when pressed, does an "Assign" of the expression "QUANTITY + 1" to the QUANTITY column.

  • There is a Command Button labeled "-" that, when pressed, does an "Assign" of the expression "QUANTITY - 1" to the QUANTITY column.

Normally, a spin control would have these buttons to the right of the edit control, each button being half as high as the edit control, with the "-" button right above the "+" button. But, if you did this, it might make the buttons hard to press with the stylus. Consider putting the "-" button to the left of the edit control and the "+" button to the right of the edit control.