SPINBUTTON Statement
Syntax:
SPINBUTTON id, x, y, width, height[, style]
The SPINBUTTON statement creates a spin button control within the dialog
window. This control gives the user quick access to a finite set of data.
The SPINBUTTON statement defines the identifier, position, dimensions,
and attributes of a spin button control. The predefined class for this
control is WC_SPINBUTTON. If you do not specify a style, the default style
is WS_TABSTOP, WS_VISIBLE, and SPBS_MASTER.
id
Specifies the control identifier. The value
is a signed integer -32768 through 32767, an unsigned integer in the range
of 1 through 65535, or a simple expression that evaluates to a value in
these ranges.
x
Specifies the x-coordinate of the lower-left
corner of the control. The value is a signed integer -32768 through 32767
or an expression consisting of integers and the addition (+) or subtraction
(-) operator. The coordinate is assumed to be in dialog units and is relative
to the origin of the dialog window.
y
Specifies the y-coordinate of the lower-left
corner of the control. The value is a signed integer -32768 through 32767
or an expression consisting of integers and the addition (+) or subtraction
(-) operator. The coordinate is assumed to be in dialog units and is relative
to the origin of the dialog window.
width
Specifies the width of the control. The
value is any integer 0 through 65535 or an expression consisting of integers
and the addition (+) or subtraction (-) operator. The width is in n-character
units.
height
Specifies the height of the control.
The value is any integer 0 through 65535 or an expression consisting of
integers and the addition (+) or subtraction (-) operator. The height is
in 1/8-character units.
style
Specifies the control styles. The value
is any combination of the styles specified for WC_SPINBUTTON. You can use
the bitwise OR ( | ) operator to combine styles.
Comments
The SPINBUTTON statement is used only in a DIALOG or WINDOW statement.
Example
This example creates a spin-button control at position (80, 20) within the
dialog window. The spin button has a width of 60 character units and a
height of 3 character units. Its resource identifier is 302. The style
specification SPBS_NUMERICONLY creates a control which accepts only the
digits 0-9 and virtual keys. The default styles SPBS_MASTER, WS_TABSTOP,
and WS_VISIBLE are all in effect, though only WS_TABSTOP is specified.
#define IDC_SPINBUTTON 302#define IDD_SPINDLG 502
DIALOG "Spin button", IDD_SPINDLG, 11, 11, 200, 240, FS_NOBYTEALIGN |
WS_VISIBLE, FCF_SYSMENU | FCF_TITLEBAR
BEGIN
SPINBUTTON IDC_SPINBUTTON, 80, 20, 60, 24, SPBS_NUMERICONLY | WS_TABSTOP
END
[Back: SLIDER Statement]
[Next: STRINGTABLE Statement]