Skip to content

Latest commit

 

History

History

CustomPicker

FMX.CustomPicker Sample

FMX.CustomPicker Sample

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

Contents

Location

You can find the CustomPicker sample project at:

Description

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.
  1. Select the target platform, iOS and Android supported.
  2. Press F9 or choose Run > Run.
  3. 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.

Files

File in Delphi File in C++ Contains
CustomPicker.dproj CustomPicker.cbproj The project itself.
uMain.fmx uMain.fmx The main form where the components are located.
uMain.pas CustomPickerPCH.h, CustomPicker.cpp Used to define and implement the sample.
Information.txt Information.txt Further information about the sample.

Classes

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

Implementation

  • The sample uses TComboBox to display a list of items and select an item from it.
  • The sample uses TListBox to locate the TComboBox on the first TListBoxItem and to display the selected item on the second TListBoxItem. 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.

Uses

See Also

Samples