You can use the New VCL Component wizard to create a new VCL component. The wizard detects which personality of the product you are using and creates the appropriate type of component.
To create a new VCL component
- Specify an ancestor component.
- Specify the class name.
- Create a unit or add the unit to a package.
To specify an ancestor component
- Choose File
New
Other
Delphi Projects and double-click the Package icon. The VCL Forms Designer is displayed.
- Choose Component
New VCL Component. This displays the first page of the New VCL Component wizard. By default, it should be set to Delphi for VCL Win32.
- Click Next. This displays the second page of the New VCL Component wizard and loads the page with ancestor components.
- Select an ancestor component from the list.
- Click Next. This displays the third page of the New VCL Component wizard.
To specify a class name
- If you want to change the default class name, enter it in the Class Name textbox.
- Enter the name of the area on the Tool Palette where you want the component to appear in the Palette Page textbox.
- Enter the unit name in the Unit Name textbox.
- Enter the search path in the Search Path textbox.
- Click Next.
Note: You can also take the default values.
To create a unit
- Select the Create Unit radio button.
- Click Finish.
To install a unit into an existing package
- Select the Install into Existing Package radio button.
- Click Next. This generates a list of existing packages.
- Select the package you want to install the unit into.
- Click Finish.
To install a unit into a new package
- Select the Install into New Package radio button.
- Click Next.
- Enter a name for the package into the File Name textbox.
- Enter a description for the package into the Description textbox.
- Click Finish. The new unit opens in the Code Editor.