[Overview][Constants][Types][Classes][Procedures and functions][Index] | Reference for unit 'DBCtrls' (#lcl)

# TCustomDBListBox

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Specifies a data-aware listbox control.

## Declaration

Source position: dbctrls.pp line 352

`type TCustomDBListBox = class(TCustomListBox)`
`protected`
`FDataLink: TFieldDataLink;` |  | FDataLink - local variable holding the identity of the field data link.
`procedure DataChange(); virtual; abstract;` |  | Performs actions needed when the linked dataset is repositioned.
`procedure KeyDown(); override;` |  | Handles key down events for the control.
`procedure Notification(); override;` |  | Handles notifications when a component is added to or removed from the control.
`procedure UpdateData(); virtual; abstract;` |  | UpdateData - method for applying any pending changes to the data.
`procedure SetItems(); override;` |  | SetItems - copies the specified Values into the Items property.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`function ExecuteAction(); override;` |  | Implements support for standard actions in the control.
`function UpdateAction(); override;` |  | Updates the state for the specified action.
`property Field: TField; [r]` |  | Field definition in the linked dataset for the control.
`property DataField: string; [rw]` |  | Name for the field in the linked dataset used in the control.
`property DataSource: TDataSource; [rw]` |  | Provides access to the linked dataset for the control.
`property ReadOnly: Boolean; [rw]` |  | Indicates if the linked dataset for the control cannot be modified.
`end;`

## Inheritance

`TCustomDBListBox` |  | Specifies a data-aware listbox control.
`TCustomListBox` |  | The base class for TListBox.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCustomDBListBox is a TCustomListBox descendant which specifies the base class for a data-aware listbox control. The control allows selection and storage of a value from a scrolling list of choices to the current record in a linked dataset.

TCustomDBListBox is the ancestor class for TDBListBox. Applications should create instances of the derived class.

Use the Items property to define the list of choices displayed in the listbox control.

The DataSource property provides access to the linked dataset where the selected value is stored. Field contains the field definition for the column in the dataset where the selected value is stored. Use the DataField property to specify the name for the Field.

## See also

TDBListBox |  | Implements a data-aware version of TListBox.
TDBListBox.DataSource |  | Provides access to the linked dataset for the control.
TDBListBox.DataField |  | Name for the field in the linked dataset used in the control.
TCustomListBox.Items |  | The list of all items defined in the control.
How To Use Data-aware Controls |  | HowToUseDataAwareControls - Hints for accessing databases.