FireMonkey Native Windows Controls
Go Up to FireMonkey Native Controls
This topic describes the native Windows controls of FireMonkey.
Contents
- 1 FireMonkey Native Windows Control Presentation
- 2 Available FireMonkey Native Windows Controls
- 3 Visual Changes to Native Windows Controls
- 4 Adding Native Windows Controls to Your Application
- 5 Combining Native Windows Controls With Non-native Controls
- 6 Advantages of the Native Windows Controls
- 7 Limitations of Native Windows Controls
- 8 See Also
FireMonkey Native Windows Control Presentation
FireMonkey provides native presentation for certain visual components.
- Set the ControlType property to
Styled
in order to have the standard FireMonkey presentation of the control.Styled
is the default value of ControlType. - Set the ControlType property to
Platform
to have the native styling of that control.
Available FireMonkey Native Windows Controls
The following list contains all the controls that support native presentation:
- TEdit
- TMemo
- TPresentedScrollBox
- TPresentedVertScrollBox
- TPresentedHorzScrollBox
- TPresentedFramedScrollBox
- TPresentedFramedVertScrollBox
Visual Changes to Native Windows Controls
When the ControlType property of a visual component is set to Platform
, the presentation of this control in the Form Designer changes to indicate that it is a native control and an small phone-like icon appears in the bottom right corner.
The following images demonstrate the look of native Windows controls at with the ControlType property set to Styled
and Platform
, at design time and at run time:
Control | Design time | Run time | ||
---|---|---|---|---|
Styled
|
Platform
|
Styled
|
Platform
| |
Adding Native Windows Controls to Your Application
To add native Windows controls to your application:
- Drop a component that supports native presentation on the form (list of supported controls).
- In the Object Inspector Properties, set the ControlType property to
Platform
. The presentation of the component at design-time changes (see Visual Changes to Native Windows Controls). - Run your application.
Alternatively, you may change the value of ControlType at run time. To select the native presentation for a TEdit control, add the following code to your application:
Delphi:
Edit1.ControlType := TPresentedControl.TControlType.Platform;
C++:
Edit1->ControlType = TPresentedControl::TControlType::Platform;
Combining Native Windows Controls With Non-native Controls
We do not recommend that you combine non-native controls with native controls, because the native controls do not support the Z-order of the form: a native control is always on top of other controls on your form. However, there are some non-native controls that you may combine with native controls because they support the Z-order of native controls.
The following list contains all the controls that have the ControlType property and therefore may be combined with native controls:
- TMultiView
- TButton
- TSpeedButton
- TColorButton
- TCornerButton
- TPopupBox
- TMagnifierGlass
- TPanel
- TLabel
- TCheckBox
- TRadioButton
- TGroupBox
- TStatusBar
- TToolBar
- TProgressBar
- TTrackBar
- TListView
The following list contains all the controls that do not have the ControlType property but may also be combined with native controls:
Advantages of the Native Windows Controls
Some controls support additional functionality when you use them as native controls:
TMemo and TEdit
- Additional context-menu items:
- Undo: Undo the last action.
- Right to left Reading order: Changes the reading order and justifies text on the right side of the control. See Microsoft Documentation - To set right-to-left reading order for more information.
- Show Unicode control characters: Shows Unicode control characters.
- Insert a Unicode control character: Inserts a Unicode control character.
- Open IME: IME stands for
Microsoft Global Input Method Editor
. It enables the typing of Japanese, Chinese and Korean into supporting applications on other versions of Windows.
The features above are provided in the context menu of the control, therefore the context menu of the memo control or the edit control is different for Styled
and Platform
:
Control | Context menu (Styled )
|
Context menu (Platform )
|
---|---|---|
Limitations of Native Windows Controls
Before using the native controls, consider the following limitations:
- Native controls do not support predefined or custom styles. When the ControlType property of a native control is set to
Platform
, the value of the StyleLookup property is ignored. - Native controls have limited support for transparent background. Transparent controls are not painted correctly.
- Native controls do not support the Z-order of the form: a native control is always on top of other FireMonkey controls available on your form. See Combining Native Windows Controls With Non-native Controls for details.
- The following event handlers are not supported and cannot be implemented:
- The following events occur but you cannot use them as intended (to override the visualization of the control). However, you may use them as an indication of when the system repaints the control:
There are also some control-specific limitations:
TMemo
The following event is not supported and cannot be implemented in TMemo:
TMemo and TEdit
Setting parameter values in the OnKeyXX
event handler does not suppress the key input.
For example, if you set KeyChar := #0;
in the OnKeyDown event handler and press the s
key, the native presentation still outputs the s
, while the styled presentation does not output anything.
The above limitation applies to these event handlers:
The following events are not supported and cannot be implemented in TMemo and TEdit:
OnValidate
See Also
- FireMonkey Native Controls
- FireMonkey Native iOS Controls
- FireMonkey Native Android Controls
- TPresentedControl.ControlType
- Customizing FireMonkey ListView Appearance
Samples
- FireMonkey Native Controls sample