VCL.Controls Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample demonstrates how to create and use custom VCL components. The application proves that you can easily modify the implementation for controls that already exist on the palette.


You can find the Controls sample project at:

  • Start | Programs | Embarcadero RAD Studio Alexandria | Samples and then navigate to CPP\VCL\Controls.
  • C:\Users\Public\Documents\Embarcadero\Studio\22.0\Samples\CPP\VCL\Controls.
  • Subversion Repository:
    • You can find C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.


The application creates and installs the C++ version of the visual components that already exist in the Samples category on the Tool Palette, plus some new ones.

These are the new components that this sample application adds to the Tool Palette:

  • TCTrayIcon
  • TPerformanceGraph
  • TCSpinButton
  • TCSpinEdit
  • TCColorGrid
  • TCGauge
  • TCDirectoryOutline
  • TCCalendar
  • TPie

How to Use the Sample

To run the example, complete the following steps:

  1. Navigate to the location given above.
  2. Load bcbsmp.bpl.
  3. Load dclbcbsmp.bpl.(By convention, dcl is the prefix for component designer packages.)
  4. Build bcbsmp.bpl.
  5. Install dclbcbsmp.bpl to install the components.
Note: In order to be able to install this project, go to Component > Install Packages and deselect Embarcadero Sample Controls Design Time Package.


File Contains


The TCCalendar class


The TCDirectoryOutline class


The TCGauge class and other helper classes


The TCColorGrid class


The TCSpinButton and TCSpinEdit classes


The TPerformanceGraph class


The TPie class and TAngle helper class


The TCTrayIcon class


The code for registering the TPie component and its property editor


The code for registering the rest of the components


  • TCCalendar implements a month calendar; it is a version of TCalendar.
  • TCDirectoryOutline implements a directory hierarchy; it is a version of TDirectoryOutline.
  • TBltBitmap is a helper class for TCGauge.
  • TCGauge implements a measurement tool; it is a version of TGauge.
  • TCColorGrid implements a grid that allows the user to select a foreground color and a background color.
  • TCSpinButton implements a spin button; it is a version of TSpinButton.
  • TCSpinEdit implements a spin edit; it is a version of TSpinEdit.
  • TPerformanceGraph implements a performance graph.
  • TAngles is a helper class for TPie.
  • TPie implements a pie component.
  • TCTrayIcon implements a tray icon; it is a version of TTrayIcon.


See Also