1. Computing & Technology

Discuss in my forum

Create Component Templates in Delphi

By , About.com Guide

Creating and using Component templates provides a simple, quick way of configuring and saving groups of components in Delphi.
Difficulty: Easy
Time Required: 5 minutes

Here's How:

  1. Start Delphi and place / arrange components on a form.
  2. In the Object Inspector, set their properties and events as desired.
  3. Select the components.
  4. Choose Component | Create Component Template...
  5. Specify a name for the component template in the Component Name edit box (be careful not to duplicate existing component names).
  6. In the Palette Page edit box, specify the Component palette page where you want the template to reside.
  7. Under Palette Icon, select a bitmap to represent the template on the palette.
  8. Click OK.

Tips:

  1. In step 3, the easiest way to select several components is to drag the mouse over all of them. Gray handles appear at the corners of each selected component.
  2. In step 6, if you specify a page that does not exist, a new page is created when you save the template.
  3. To remove templates from the Component palette, choose Component|Configure Palette.
  4. By selecting the template from the Component palette, you can place the preconfigured components on a form in a single step; all associated properties and event-handling code are added to your project at the same time.

©2012 About.com. All rights reserved.

A part of The New York Times Company.