FMX.Customcontrol Sample

From Appmethod Code Examples
Jump to: navigation, search

This sample illustrates how to create a custom control in FireMonkey.


You can find the customcontrol sample project at:


This application creates a customized visual control. The result is a circle with a different style depending on the operating system.

How to Use the Sample

  1. Navigate to the location given above, and open customcontrol.dproj.
  2. Press F9 or choose Run > Run.


Form6 represents the main window of the sample. No controls are placed on the form at design time. The customized control is created in the form's OnCreate event, using the TMyControl class, derived from TStyledControl.


  • customcontrolfrm.pas is the main source file.
  • fmx.customcontrol.pas contains the implementation of TMyControl. This file is added to the project's uses list.
  • The and files define the different styles for the control, according to the platform the application runs on.


See Also