FMX.CustomPicker Sample

From RAD Studio Code Examples
Jump to: navigation, search

This sample demonstrates how to use the TComboBox component to customize and invoke an item picker.


You can find the CustomPicker sample project at:

  • Start | Programs | Embarcadero RAD Studio Alexandria | Samples and then navigate to:
    • Object Pascal\Mobile Snippets\CustomPicker
    • CPP\Mobile Snippets\CustomPicker
  • Subversion Repository:
    • You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.


The CustomPicker sample demonstrates how to use an item picker on Android and iOS devices. The sample uses TComboBox to customize the options of the picker and to allow the user to pick an item and display the text of the selected item on a label.

How to Use the Sample

  1. Navigate to one of the locations given above and open:
    • Delphi: CustomPicker.dproj.
    • C++: CustomPicker.cbproj.
  2. Select the target platform, iOS and Android supported.
  3. Press F9 or choose Run > Run.
  4. Interact with the sample:
    • Click or tap the TComboBox control. See how it displays the native picker that allows you to select an item.
    • Select an item.
    • The sample displays the text of the selected item on a label.


File in Delphi File in C++ Contains



The project itself.



The main form where the components are located.


CustomPickerPCH.h, CustomPicker.cpp

Used to define and implement the sample.



Further information about the sample.


TCustomPickerForm is the main form that represents the main window of the sample. It contains the following components:


When you run the application, there are two TListBoxItems. In the first TListBoxItem, click on the TComboBox next to Pick an Item. Then, the sample displays an item picker that allows you to select one of the four items. When you select an item, an OnChange event displays the text of this item in the second TListBoxItem.


See Also