Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Learn How to Apply Robust Native Controls In FireMonkey With Delphi And C++

The NativeControls sample shows the use of the Native Controls of FireMonkey. To this end it uses several components that are configured with its ControlType property set to Platform in order to have the native styling of that control.

Note: Only iOS and Windows support native controls. The following links provide a list of controls that support native presentation on iOS and Windows platforms. The value of ControlType property on any other platform does not have any effect.

Location

You can find the NativeControls sample project at:

How to Use the Sample

  1. Navigate to one of the locations given above and open:
    • Delphi: NativeControlsDemo.dproj.
    • C++: NativeControlsDemo.cbproj.
  2. Select the target platform in the Projects Window.
  3. Press F9 or choose Run > Run.

Files

File in DelphiFile in C++Contains
NativeControlsDemo.dproj
NativeControlsDemo.dpr
NativeControlsDemo.cbproj
NativeControlsDemo.cpp
The project itself.
MainFrm.pas
MainFrm.fmx
MainFrm.h
MainFrm.cpp
MainFrm.fmx
The main form.

Implementation

FireMonkey provides native presentation for certain visual components. Although the default value of the ControlType property is Styled, which means that the control has the standard FireMonkey presentation, if you set the ControlType property to Platform, the controls have the native styling. In the sample, when you run the application, it shows four tabs labeled as EditMemoStandard and ListView. Each tab contains several controls. All the controls have the ControlType property set to Platform in order to have the native styling of that control. Moreover, the controls are also configured with other properties that are explained below.

Please check the Native Controls Sample’s original post via the next link:

http://docwiki.embarcadero.com/CodeExamples/Sydney/en/FMX.NativeControls_Sample

Head over and check out the full source code for the native controls demo in Delphi on GitHub.

Head over and check out the full C++ source code for native controls in C++Builder on GitHub.

Exit mobile version