Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming

How to Create the Basic Unit For a New Component
From your Delphi Programming Guide

Steps to crating a new (graphics) component from TImage. Or, in other words, how to create a new component from an existing one.

Difficulty Level: Easy    Time Required: 5 minutes


Here's How:
  1. Start Delphi and select File | New ...
  2. Double-click the Component icon in the Object Repository.
  3. The 'New Component' dialog box is displayed.
  4. Use the drop-down list to select a base class (Ancestor type).
  5. Select TImage.
  6. Type the name of your new component's class in the Class Name field. Type TPictureClip (or some other name)
  7. Select the Component palette location in which you want to place this derived component. Select 'Samples'.
  8. Click on OK.
  9. The Code Editor appears and displays a new source code unit.
  10. Save the unit as PictureClip.pas.
  11. You are now ready to code you own TPictureClip component.


Related Information:




More How To's from your Guide to Delphi Programming


Put this How To on your PDA!




Explore Delphi Programming

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.