When using TDBListBox or TDBComboBox, you must use the String List editor at design time to create the list of items to display. To bring up the String List editor, click the ellipsis button for the Items property in the Object Inspector. Then type in the items that you want to have appear in the list. At runtime, use the methods of the Items property to manipulate its string list.
When a TDBListBox or TDBComboBox control is linked to a field through its DataField property, the field value appears selected in the list. If the current value is not in the list, no item appears selected. However, TDBComboBox displays the current value for the field in its edit box, regardless of whether it appears in the Items list.
For TDBListBox, the Height property determines how many items are visible in the list box at one time. The IntegralHeight property controls how the last item can appear. If IntegralHeight is False (the default), the bottom of the list box is determined by the ItemHeight property, and the bottom item may not be completely displayed. If IntegralHeight is True, the visible bottom item in the list box is fully displayed.
For TDBComboBox, the Style property determines user interaction with the control. By default, Style is csDropDown, meaning a user can enter values from the keyboard, or choose an item from the drop-down list. The following properties determine how the Items list is displayed at runtime:
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|