rc.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CONTROL (1.2)
                                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
 
                  The Resource Compiler CONTROL Statement
 
CONTROL text, id, x, y, width, height, class[, style]
[ data-definitions ]
[ BEGIN
control-definition
    .
    .
    .
END ]
 
The CONTROL statement defines a control as belonging to the specified class.
The statement defines the position and dimensions of the control within the
parent window, as well as the control style. The CONTROL statement is most
often used in a DIALOG or WINDOW statement.
 
Typically, several CONTROL statements are used in each DIALOG statement, and
each CONTROL statement must have a unique id value. The optional BEGIN and
END statements enclose any CONTROL statements that may be given with the
control. CONTROL statements given in this manner represent child windows
belonging to the control created by the CONTROL statement.
 
Field               Description
────────────────────────────────────────────────────────────────────────────
 
text                Specifies text that is displayed to the right of the
                    control. This field must contain zero or more characters
                    enclosed in double quotation marks. Character values
                    must be in the range 1 through 255. If a double
                    quotation mark is required in the text, you must include
                    the double quotation mark twice. In the appropriate
                    styles, a tilde (~) character in the text indicates that
                    the following character is used as a mnemonic character
                    for the control. When the control is displayed, the
                    tilde is not shown, but the mnemonic character is
                    underlined. The user can choose the control by pressing
                    the key corresponding to the underlined mnemonic
                    character.
 
id                  Specifies the control identifier. This value must be an
                    integer in the range 0 through 65,535, or a simple
                    expression that evaluates to a value in that range.
 
x                   Specifies the x-coordinate of the lower-left corner of
                    the control. This value must be an integer in the range
                    0 through 65,535 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 parent window.
 
y                   Specifies the y-coordinate of the lower-left corner of
                    the control. This value must be an integer in the range
                    0 through 65,535 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 parent window.
 
width               Specifies the width of the control. This value must be
                    an integer in the range 1 through 65,535 or an
                    expression consisting of integers and the addition (+)
                    or subtraction (-) operator. The value is in ¼-character
                    units.
 
height              Specifies the height of the control. This value must be
                    an integer in the range 1 through 65,535 or an
                    expression consisting of integers and the addition (+)
                    or subtraction (-) operator. The value is in
                    1/8-character units.
 
class               Specifies the control class. This value can be one of
                    the classes specified in the topic Control Classes or
                    the name of the control class enclosed in double
                    quotation marks.
 
style               Specifies the control style. For a list of possible
                    classes, see the topic Control Styles. You can use the
                    bitwise OR (|) operator to combine styles.
 
data-definitions    Specifies a CTLDATA and/or PRESPARAMS statement. These
                    statements define control and presentation data for the
                    control. For more information, see the CTLDATA and
                    PRESPARAMS topics.
 
control-definition  Specifies a CONTROL statement or any one of several
                    predefined control statements. These statements define
                    the style, position, and dimensions of controls in the
                    control.
 
Comments
 
The CONTROL statement can actually contain any combination of CONTROL,
DIALOG, and WINDOW statements. Typically, a CONTROL statement contains no
such statements.
 
Example
 
This example creates a push-button control with the WS_TABSTOP and
WS_VISIBLE styles.
 
CONTROL "OK", 101, 10, 10, 20, 50, WC_BUTTON, BS_PUSHBUTTON |
                                              WS_TABSTOP    |
                                              WS_VISIBLE
 
See Also
 
AUTOCHECKBOX, AUTORADIOBUTTON, CHECKBOX, CTLDATA, DEFPUSHBUTTON, DIALOG,
GROUPBOX, PRESPARAMS, PUSHBUTTON, RADIOBUTTON, WINDOW