SLIDER Statement
Syntax:
SLIDER id, x, y, width, height[, style]
The SLIDER statement creates a slider control within the dialog window.
This control lets the user set, display, or modify a value by moving a
slider arm along a slider shaft. The SLIDER statement defines the identifier,
position, dimensions, and attributes of a slider control. The predefined
class for this control is WC_SLIDER. If you do not specify a style, the
default style is WS_TABSTOP and WS_VISIBLE.
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
can be any combination of the styles specified for WC_SLIDER. You can use
the bitwise OR ( | ) operator to combine styles.
Comments
The SLIDER statement is only used in a DIALOG or WINDOW statement.
Example
This example creates a slider control at position (40, 30) within the dialog
window. The slider has a width of 120 character units and a height of 2
character units. Its resource identifier is 101. The style specification
SLS_BUTTONSLEFT adds buttons to the left of the slider shaft. The default
styles WS_TABSTOP and WS_VISIBLE are both in effect, though only the latter
is specified.
#define IDC_SLIDER 101#define IDD_SLIDERDLG 502
DIALOG "Slider", IDD_SLIDERDLG, 11, 11, 200, 240, FS_NOBYTEALIGN |
WS_VISIBLE, FCF_SYSMENU | FCF_TITLEBAR
BEGIN
SLIDER IDC_SLIDER, 40, 30, 120, 16, SLS_BUTTONSLEFT | WS_VISIBLE
END
[Back: RTEXT Statement]
[Next: SPINBUTTON Statement]