Try OpenEdge Now
skip to main content
Online Help
Introducing the Progress Developer Studio for OpenEdge Visual Designer : Tasks : Developing a visual container : Working with UI controls : Choosing controls for the UI : Adding controls to a container
 
Adding controls to a container
There are several ways to place a control on a form on the Design Canvas:
*Clicking - Select a control in the Toolbox and click once on the form at the desired position to place an instance of the control at its default size.
*Double-clicking - Double-click a control in the Toolbox to add an instance of the control at its default size. The new control overlaps the last control that you operated on, if applicable, or appears at the top left corner of the form.
*Dragging - Click a control in the Toolbox, hold down the primary mouse button, and drag the control to the desired position on the form. When you release the mouse button, an instance of the control appears at its default size. (Alternatively, you can drag the control to a container node in the Outline view.)
*Drawing - Select a control in the Toolbox, point to the desired position on the form, and draw a rectangular outline of the size and shape you want the control to have. When you release the mouse button, an instance of the control appears, occupying the outlined area. (Some controls have shape constraints that prevent them from taking both dimensions of the outlined rectangle.)
*Copying/cutting and pasting - Click the pointer tool in the Toolbox to activate selection mode. Then select one or more controls on the Design Canvas, copy or cut them, and paste new instances onto the form. The Copy (Ctrl+C), Cut (Ctrl+X), and Paste (Ctrl+V) commands are available on the Edit menu and on the Design Canvas context (right-click) menu. You can also copy a control by pressing Ctrl while dragging to the desired location for the duplicate instance. Copy and paste operations are valid between separate UI classes.
Note: When you add certain controls (for example, the UltraGrid), a Quick Start wizard may be launched.
Note: You cannot add a control to a form if the form's Language property is set to any value other than Default. Attempting to do so results in an error message.
Placing controls inside a container control
In general, when you place a control on the main form, the control becomes a child object of the form. Certain controls (for example, the Panel control), however, can contain other controls; in such cases, the container control is the parent of the child objects placed within it. Adding or moving a control within the boundaries of a container control creates a parent-child relationship between the two controls.
Note: You can use the Outline view to make a control the child of a different parent container, without moving the control on the Design Canvas.
Adding menu, toolbar, and status bar controls to an MDI Form
The ABL MDI Form offers special design-time functionality. When you click anywhere on the default container controls—the menu strip, toolbar, or status bar—an embedded design control is launched. These design controls do not appear on the form at run time. Rather, they serve as an easy way to add controls to those container controls.
Adding menu controls
When you click anywhere on the menu strip, one or more text boxes with drop-down arrows appear that allow you to enter new menus and menu options. If you click a blank area on the menu strip, a single text box appears on the menu strip; typing in that box creates a new top-level menu. If you click an existing menu title, additional boxes appear within the menu structure; typing in them creates new menu options or sub-menus.
In addition to standard menu items, you can add ComboBox, Separator, and TextBox controls. Point the cursor inside the text box to display the down arrow to the right. Click this arrow and select the desired control from the drop-down list.
Adding toolbar controls
When you click anywhere on the toolbar buttons, an Add Control button appears. To use this tool to add a standard button, which is the default, just click the button. A new button with a default image appears.
The Add Control tool can also add several other control types: Label, SplitButton, DropDownButton, Separator, ComboBox, TextBox, and ProgressBar. To add one of these controls, click the down arrow to the right of the image and select the desired control from the drop-down list.
Adding status bar controls
The status bar offers a similar Add Control button . Click the button to add the default control, a label. Click the drown arrow to select one of the other control types: ProgressBar, DropDownButton, or SplitButton.
Controls on the Design Canvas
Keep in mind that with the exception of the MDI controls described in the preceding section, the controls shown on the Design Canvas are not "live"; they are merely a representation of how the visual container will appear at run time.