FMX.KeyboardToolbar Sample

From RAD Studio Code Examples
Jump to: navigation, search

This is a sample that shows the use of a popup keyboard in mobile applications using FireMonkey.

Note: This sample application only works on iOS. It does not work on Android.
Click Add to create a new custom button


You can find the FireMonkeyMobile KeyboardToolbar sample project at:

  • Start | Programs | Embarcadero RAD Studio Sydney | Samples and navigate to:
    • Object Pascal\Multi-Device Samples\User Interface\KeyboardToolbar
    • CPP\Multi-Device Samples\User Interface\KeyboardToolbar
  • 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.


This application illustrates how to customize the toolbar associated to the virtual keyboard using the IFMXVirtualKeyboardToolbarService.

Entering the caption for a button being created

How to Use the Sample

  1. Navigate to the one of the locations given above, and open:
    • Delphi: KeyboardToolbar.dproj
    • C++: KeyboardToolbar.cbproj
  2. Press F9 or choose Run > Run.
  3. To observe the functionality of the Keyboard Toolbar, follow the following steps:
  • To invoke the virtual keyboard, use the TEdit control (named Edit1).
  • To enable or disable the Keyboard Toolbar, switch the TSwitch control (named swToolbar) On or Off.
  • To add a TVirtualKeyboardToolButton button to the Keyboard Toolbar, use the Add button (named btnAdd). Notice that the button is visible in the Keyboard Toolbar (displayed over the virtual keyboard) and in the TListBox list box (lbButtons).
  • To remove a TVirtualKeyboardToolButton button from the Keyboard Toolbar, select the button from the TListBox (lbButtons) and press the Delete button (named btnDelete).
My button is created. Press it


TForm1 (named Form1) is the main window of the KeyboardToolbar sample. It contains the following components:

  • TToolBar named ToolBar1
    • Two TButton buttons named btnAdd and btnDelete
  • TListBox named lbButtons that is intended to contain keyboard toolbar buttons created with the btnAdd button.
  • TListBox named ListBox1 contains:



See Also