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

# TCustomDBComboBox

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

TCustomDBComboBox is a data-aware combo-box for displaying information from a database.

## Declaration

Source position: dbctrls.pp line 744

`type TCustomDBComboBox = class(TCustomComboBox)`
`protected`
`function DoEdit; virtual;` |  | Performs LCL deferred edit messages for events detected in the control.
`procedure DoOnCloseUp; virtual;` |  | Performs actions to close the drop down for the combo-box.
`procedure DoOnSelect; virtual;` |  | Calls Select to trigger the OnSelect event handler.
`procedure DoOnChange; virtual;` |  | Calls Change to trigger the OnChange event handler.
`procedure LMDeferredEdit(); message;` |  | Implements the LCL message for a deferred edit.
`property DetectedEvents: Word; [r]` |  | Deferred messages pending for the control.
`procedure CloseUp; override;` |  | Sets deferred events when the drop down for the combo-box is closed.
`procedure Select; override;` |  | Checks for the DBCBEVENT_SELECT message in the control.
`procedure DataChange(); virtual; abstract;` |  | DataChange - updates any changes in text.
`function DoMouseWheel(); override;` |  | Checks for mouse wheel events in the control.
`procedure Notification(); override;` |  | Notification handler for insertion or deletion of components.
`procedure Change; override;` |  | Change -if there has been a change to the data the link must be notified.
`procedure KeyDown(); override;` |  | Performs actions needed to apply the key down event.
`procedure UpdateData(); virtual; abstract;` |  | UpdateData - implements any pending changes in the data.
`procedure UpdateRecord;` |  | Updates the record in the linked dataset with the value for the control.
`procedure WndProc(); override;` |  | Handles cut, copy and paste window messages for the control.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`function ExecuteAction(); override;` |  | Provides support for TBasicAction in the control.
`function UpdateAction(); override;` |  | Updates the specified action to reflect the current state in the linked dataset.
`procedure EditingDone; override;` |  | Updates data through the link, then calls inherited EditingDone.
`property Field: TField; [r]` |  | Contains the field definition from the linked dataset.
`property Text: TCaption;` |  | The value in the edit box for the control.
`property ItemIndex: Integer;` |  | The index of the currently selected item, or -1 if no item is selected.
`property DataField: string; [rw]` |  | The name of the Field which provides the values displayed in the control.
`property DataSource: TDataSource; [rw]` |  | Provides access to the dataset with content for the control.
`property ReadOnly: Boolean; [rw]` |  | Indicates if the control is prevented from changing the field value in its linked dataset.
`end;`

## Inheritance

`TCustomDBComboBox` |  | TCustomDBComboBox is a data-aware combo-box for displaying information from a database.
`TCustomComboBox` |  | The base class for combo-box components.
`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

TCustomDBComboBox is a TCustomComboBox descendant which specifies a data-aware combo-box control used to display and edit values in a database table. TCustomDBComboBox extends the ancestor class to provide DataField, DataSource, and Field properties needed to control access to the field in a linked dataset.

Methods are provided which enable the database features for the control, and maintain the interaction between the control and the underlying dataset. Internally, a TFieldDataLink class instance is used to maintain the association between the control and it data source and field.

TCustomDBComboBox is used as the ancestor for the TDBComboBox and TDBLookupComboBox controls. Do not create instances of TCustomDBComboBox; use one of the descendent classes.

## See also

TDBComboBox |  | TDBComboBox is a data-aware version of TComboBox which allows selection of a value from a list of entries into a database field.
TDBLookupComboBox |  | TDBLookupComboBox is a data-aware combo-box for examining a lookup table in a database.
TCustomComboBox |  | The base class for combo-box components.
How To Use Data-aware Controls |  | HowToUseDataAwareControls - Hints for accessing databases.