Adding Components to a Form

From RAD Studio
Jump to: navigation, search

Go Up to How To Create Forms and Projects, and Write the Code Behind


To Add a Component to a Form

To add a new visual or nonvisual component to a form, use any of the following three procedures:

Double-Click a Component on the Tool Palette

  1. On the Form Designer, select an existing container (for example, the form itself) to be the parent of the new component.
  2. On the Tool Palette, locate the new component. You can use the search field SearchGlass.png in the Tool Palette.
  3. Double-click the new component to add the new component to the form.
    • The new component is added to the form as a child of the selected container.
    • If you select a regular component instead of a container, the new component is added to the form as a sibling of the selected component, that is, as a child of the parent of the selected component.

Select a Component and Click on the Form

  1. On the Tool Palette, locate the component you want to add. You can use the search field SearchGlass.png in the Tool Palette.
  2. Click the new component to select it.
  3. On the Form Designer, click an existing container (for example, the form itself) to add the new component to the form as a child of the clicked container.
Note: If you click a regular component instead of a container, the new component is added to the form as a sibling of the clicked component, that is, as a child of the parent of the clicked component. You can see the parent/child relationships of components in the Structure View.

Drag a Component from the Tool Palette onto the Form Designer

  1. On the Tool Palette, locate the new component. You can use the search field SearchGlass.png in the Tool Palette.
  2. Drag the new component from the Tool Palette onto the Form Designer.
    • If you drag the new component onto a container component (for example, onto the form itself), the new component is added to the form as a child of the target container.
    • If you drag the new component onto a regular component instead, the new component is added to the form as a sibling of the target component, that is, as a child of the parent of the target component.
Note: Nonvisual components can only be children of the form container itself; they cannot be children of any other container. If you try to add a nonvisual component as a child of a regular container, RAD Studio makes the new component a child of the form instead. Some FireMonkey nonvisual components, such as animation effects and image effects, are exceptions to this rule, and you can make them children of any other component.

To Quickly Add Components of the Same Class to a Form

To add several components of the same class to your form quickly, follow these steps:

  1. Shift+Click the target component in the Tool Palette to make the selection sticky, so that the IDE does not deselect your component after you add it to your form.
  2. Click on your form as many times as you want to add components of the selected class.
  3. Click the arrow cursor icon in the Tool Palette to deselect the component after you add the number of components you want.

See Also