FMX.ListBox.TComboBox
Delphi
TComboBox = class(TCustomComboBox)
C++
class PASCALIMPLEMENTATION TComboBox : public TCustomComboBox
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
class | public | FMX.ListBox.pas FMX.ListBox.hpp |
FMX.ListBox | FMX.ListBox |
Description
A TComboBox is a button with a list box attached to it.
Click the button to display the list. You can select an item from the list and it will appear as the button's text. You cannot type text directly into the combo box button.
To add items, right-click the combo box on the form and choose Add Item. This creates a new TListBoxItem object that appears in the Structure pane and can be edited individually. You can also manage the items in the combo box by double-clicking the combo box control in the Form Designer. This opens the Items Designer dialog where you can add, delete, and change the order of the items.
- Note: When a number of items in a control is more than can be concurrently shown in the TListBoxItem list box, then you can use the scroll bar to scroll the items shown in the list box. Notice that on Windows the scroll bar is shown by default. However, on OS X the scroll bar is not shown by default. On OS X, the scroll bar appears when you try to scroll items using the mouse wheel. To enforce the scroll bar to be shown by default, you can use the code like following:
ComboBox1.ListBox.AniCalculations.AutoShowing := false;
- Note: When a number of items in a control is more than can be concurrently shown in the TListBoxItem list box, then you can use the scroll bar to scroll the items shown in the list box. Notice that on Windows the scroll bar is shown by default. However, on OS X the scroll bar is not shown by default. On OS X, the scroll bar appears when you try to scroll items using the mouse wheel. To enforce the scroll bar to be shown by default, you can use the code like following:
In Windows 8 style applications, you can create a Windows 8 style combo box by setting the value Native for the property DropDownKind. For more information, see Creating a Metropolis UI ComboBox.
See Also
- Mobile Tutorial: Using Combo Box Components to Pick Items from a List (iOS and Android)
- FMX.ListBox.TComboListBox
- FMX.ListBox.TListBox
- FMX.ListBox.TListBoxItem
- Mobile Code Snippets
- Structure View
- FMX.ListBox.TCustomComboBox.ListBox
- FMX.Layouts.TCustomScrollBox.AniCalculations
- FMX.InertialMovement.TAniCalculations.AutoShowing
Code Examples