FMX.Customcontrol Sample

From Appmethod Code Examples
Jump to: navigation, search

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

Location

You can find the customcontrol sample project at:

Description

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.

Classes

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.

Implementation

  • 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 fmx.customcontrol.win.style and fmx.customcontrol.mac.style files define the different styles for the control, according to the platform the application runs on.

Uses

See Also