Installing a Single Source Delphi Component Into an Existing Package

Installing a Single Source Delphi Component Into an Existing Package

We are searching data for your request:

Forums and discussions:
Manuals and reference books:
Data from registers:
Wait the end of the search in all databases.
Upon completion, a link will appear to access the found materials.

There are many free source Delphi components around the Internet you can install freely and use in your applications.

If you need to install a third-party Delphi component, and you only have the .PAS source file(s), follow this step-by-step tutorial and learn how to add the component into an existing package.

Note: This tutorial covers installing components in Delphi for Win32 (Delphi 7).

You'll learn how to install the TColorButton component.

01of 06

Starting Delphi: Preparing to Install a New Component

Zarko Gajic

First, start Delphi. A new project is created by default… Close it by pointing to File - Close All.

02of 06

Delphi IDE Menu: Component - Install Component

Zarko Gajic

Once the default new project is closed, select the "Install Component" menu item from the "Component" main Delphi IDE menu.

This will invoke the 'Install Component' dialog.

03of 06

"Install Component" Dialog Box

Zarko Gajic

With the "Install Component" dialog active, select the file with the component's source (?.PAS). Use the Browse button to select the unit, or enter the name of the unit you want to install in the "Unit File Name" edit box.

Note 1: If the unit's folder is in the Search Path, a full path name is not required. If the folder containing the unit file is not in the Search Path, it will be added to the end.

Note 2: The "Search Path" edit box displays the path used by Delphi to search for files. Leave this as it is.

04of 06

Select Delphi Package for the Component

Zarko Gajic

Use the "Package file name" drop-down list to select the name of an existing package. Note: all Delphi components are installed in the IDE as packages.

Note 1: The default package is "Borland User Components", there is no special need to alter this.

Note 2: The screenshot shows that the package "ADP_Components.dpk" is selected.

With the component's unit and package selected, hit the "OK" button on the "Install Component" dialog box.

05of 06

Confirm Adding a New Component

Zarko Gajic

With the component's unit and package selected, after you hit the "OK" button on the "Install Component" dialog box Delphi will prompt you whether you want to rebuild the modified package or not.

Click on "Yes"

After the package is compiled, Delphi will show you a message saying that the new TColorButton (or whatever the component name is) component was registered and already available as part of the VCL.

Close the package detail window, allowing Delphi to save the changes to it.

06of 06

Using the Installed Component

Zarko Gajic

If all went well, the component is now available in the components palette.

Drop the component on a form, and simply: use it.

Note: if you have more units with components, just go back to Step 2: "Delphi IDE menu: Component - Install Component" and start from there.