uspinbutton (SpinButton)

The uspinbutton widget enables the user to enter or select a numeric value by clicking a button to increase or decrease a value by a predefined interval within a predefined range. Uniface provides a logical widget called SpinButton, which is mapped to uspinbutton.

Spin button

Widget Overview
Logical widget name: SpinButton
Maps to physical widget:


Default definition:


Use for: Numeric fields
Supported triggers: trigger valueChanged—see Trigger Activation
Supported properties: See Widget Properties
Supported in egrid(Grid) widget? Yes. Some properties may not be applicable.

For more information, see egrid (Grid) and Widgets and Properties Supported in Grid Widget.

Supports MSAA? : No


The uspinbutton displays a numeric value with two arrow buttons next to the value.

Clicking the up-arrow (or the right-arrow for horizontal orientation) increases the value by a specified increment value up to the maximum value. Clicking the down-arrow (or left-arrow) decreases the value by the same increment value down to the minimum value.

You can also edit the value displayed.

This widget is not supported in character mode and is mapped to a text field.

Range ValRep and Values

To define the range of values that the widget accepts, define the ValRep property of a field as MinValue:MaxValue, where MinValue are MaxValue an integer or floating point number. For example: -5:10.

Any value assigned to a field with the uspinbutton widget must meet the following criteria:

  • It must be a numeric or floating-point data type.
  • It does not contain a decimal grouping character (. or ,) to set off thousands decimal places; for example,123,456 is not allowed.
  • If the data type is numeric, the maximum integer value is 2,147,483,647 and the minimum integer value is -2,147,483,648.
  • Field layout is not supported.
  • On Microsoft Windows, the decimal separator depends on the Windows setting (Start >Settings >Control Panel >Regional Options >Numbers >Decimal symbol).

If the ValRep defines multiple ranges it will only use the first range specified. If it includes Representations, these are ignored. For more information, see ValRep.

Trigger Activation

If you use the arrow buttons to increase or decrease the value in the uspinbutton wiget, Uniface activates the valueChanged trigger with each new value. If you hold down one of the arrow buttons (causing the spin button to cycle through a range of possible values), Uniface activates the valueChanged trigger when the arrow button is released.

If you enter a value in a uspinbutton field, Uniface activates the valueChanged trigger immediately, unlike some other widgets, which activate the valueChanged trigger only when you leave a field.

Widget Properties

Spin Button Widget Properties
Property Technical Name Dynamic?
3-D Effect (3d) 3D No
Acceleration (Accel) Accel Yes
Attach to Window Border (attach) Attach Yes
Auto Select (autoselect) AutoSelect Yes
Background Color (BackColor) BackColor Yes
Dimmed Background Color (DimmedBackColor) DimmedBackColor Yes
Bottom Line (BottomLine) BottomLine Yes
Delay Delay Yes
Double-Click (DblClk) DblClk Yes
Draw 3-D Frame Outside (DrawOutside) DrawOutside No
Foreground Color (ForeColor) ForeColor Yes
Frame Frame No
Increment Value Increment Yes
Label Font (LabelFont) LabelFont Yes
Maximum Value

Minimum Value

These entries are not mapped to widget properties. They are mapped to minimum and maximum values in the ValRep list (as Minimum:Maximum). For example:$valrep(NUMFLD)="-15:15" Yes
Mouse Pointer (Cursor) Cursor Yes
Orientation Orientation Yes
Repeat Repeat Yes
Tool Tip Text (ToolTipText) ToolTipText Yes
Widget Font (Font) Font Yes
Attach Margin (AttachMargin) AttachMargin Yes
Popup Rectangle (PopupRect) PopupRect Yes