


Create
You create controls using the DISPLAY statement. You can either specify the control's characteristics directly in the DISPLAY statement, or you can refer to a Screen Section entry that defines one or more controls. If you do not use the Screen Section, then the DISPLAY verb returns a handle to the new control. For Screen Section controls, the runtime automatically creates and stores the handle for you.
Use the MODIFY verb to set properties and invoke methods of a control. The MODIFY verb takes a control's home position (upper left corner), its handle, or the name of an elementary Screen Section item, as its first parameter. Only the properties of the control that are specified in the MODIFY statement are updated.
In addition, you can use the DISPLAY statement to update the properties of a control specified in the Screen Section. When a DISPLAY statement is used, the runtime compares the control's current specification with its original specification in the Screen Section and changes any aspects that are different. For example, if you want to change the value of a control, simply change the VALUE data item referenced in the Screen Section and DISPLAY that Screen Section entry. Note that this applies mainly to common properties and styles like SIZE, POSITION, and VISIBLE. To change the special properties defined by (or specific to) an ActiveX control, you must use the MODIFY verb.
Inquire
You can use the INQUIRE verb to get information about a control, including its value, without having to activate the control. The INQUIRE verb is used to retrieve a control's current title, value, and other control-specific properties. See the entry for INQUIRE in section 6.6, Book 3, "Reference Manual."
Destroy
Use the DESTROY verb to destroy a control. The DESTROY verb takes a control's home position (upper left corner), its handle, or the name of an elementary Screen Section item, as its first parameter. Note that the runtime automatically destroys controls associated with a floating window when the floating window is destroyed.
The following table specifies the COBOL verbs used to create, display, modify, and destroy controls. Note that when controls are created individually with the DISPLAY verb, the controls' handles must be managed by the program. For a discussion of handles, see Chapter 4, section 4.1.
| CONTROLS
| Defined individually
| Defined in the SCREEN SECTION
|
| Create
| DISPLAY
| DISPLAY
|
| Accept
| ACCEPT
| ACCEPT
|
| Modify
| MODIFY
| DISPLAY, MODIFY
|
| Destroy
| DESTROY
| DESTROY |