Creating a Component Template

From RAD Studio
Jump to: navigation, search

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

You can save selected, preconfigured components on the current form as a reusable component template accessible from the Tool Palette.

To create a component template

  1. Place and arrange components on the form.
  2. In the Object Inspector, set the component properties and events as desired.
  3. Select the components that you want to save as a component template.
    • To select several components, drag the mouse over them.
    • To select all of the components on the form, choose Edit > Select All .
    Gray handles appear at the corners of each selected component.
  4. Choose Component > Create Component Template .
    The Component Template Information dialog box appears.
  5. Specify a name for the template, and a Tool Palette page (category) and icon for the template.
  6. Click OK.

Your new template appears immediately on the Tool Palette, in the category that you specified.

To use a component template

  1. Display the form to which you want to add the components from the component template.
  2. On the Tool Palette, double-click the component template icon.
    The components in the component template are added to the form, along with their preconfigured properties and events. You can reposition the components independently, reset their properties, and create or modify event handlers for them, just as if you had placed each component in a separate operation.

To delete a component template

  1. On the Tool Palette, right-click the component template to display a context menu.
  2. Choose the Delete [template name] Button command.
    The component template is deleted immediately from the Tool Palette.

See also