CONTAINER Statement
Syntax:
CONTAINER id, x, y, width, height [,style]
The CONTAINER statement creates a container control within a dialog window.
The container control is a visual component that holds objects. The CONTAINER
statement defines the identifier, position, dimensions, and attributes of
a container control. The predefined class for this control is WC_CONTAINER.
If you do not specify a style, the default style is WS_TABSTOP, WS_VISIBLE,
and CCS_SINGLESEL.
id
Specifies the control identifier. This 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. This 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 containing the container control.
y
Specifies the y-coordinate of the lower-left
corner of the control. This 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 containing the container control.
width
Specifies the width of the control. This
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.
This 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. This value
can be a combination of the styles specified for WC_CONTAINER. Use the bitwise
OR (|) operator to combine styles.
Comments
A CONTAINER statement is only used in a DIALOG or WINDOW statement.
Example
This example creates a container control at position (30,30) within the
dialog window. The container has a width of 70 character units and a height
of 25 character units. Its resource identifier is 301. The default style
CCS_SINGLESEL has been overridden by the style specification CCS_MULTIPLESEL.
The default styles WS_TABSTOP and WS_GROUP are both in effect, though only
the latter is specified.
#define IDC_CONTAINER 301#define IDD_CONTAINERDLG 504
DIALOG "Container", IDD_CONTAINERDLG, 23, 6, 120, 280, FS_NOBYTEALIGN |
WS_VISIBLE, FCF_SYSMENU | FCF_TITLEBAR
BEGIN
CONTAINER IDC_CONTAINER, 30, 30, 70, 200, CCS_MULTIPLESEL |
WS_GROUP
END
[Back: COMBOBOX Statement]
[Next: CONTROL Statement]