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

TDBLookupListBox

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

Implements a data-aware listbox control with database lookup capabilities.

Declaration

Source position: dbctrls.pp line 454

type TDBLookupListBox = class(TCustomDBListBox)

protected

  procedure DataChange(); override;

  

Performs actions needed when a new DataField value is selected using the lookup dataset.

  procedure DoSelectionChange(); override;

  

Performs actions needed when the selected item in the listbox is changed.

  procedure InitializeWnd; override;

  

Initializes the window handle for the control.

  procedure DestroyWnd; override;

  

Frees the window handle and updates the address used for the Items in the controls.

  procedure KeyDown(); override;

  

Applies the specified virtual key code to the control.

  procedure Loaded; override;

  

Performs actions needed when the control has loaded using the LCL streaming mechanism.

  procedure UpdateData(); override;

  

Updates the data in the lookup dataset for the control.

  function IsUnbound;

  

Indicates if the control is being used in the "unbound" mode.

public

  constructor Create(); override;

  

Constructor for the class instance.

  property KeyValue: Variant; [rw]

  

Accesses the value for the KeyField in the lookup dataset.

published

  property Align: TAlign;

  

Specifies the placement of the control on its Parent control.

  property Anchors: TAnchors;

  

The set of anchor definitions for this control.

  property BiDiMode: TBiDiMode;

  

Indicates whether text controls use in bi-directional reading.

  property BorderSpacing: TControlBorderSpacing;

  

Determines the inner and outer border spacing for this control.

  property BorderStyle: TBorderStyle;

  

Indicates the border style displayed around the control.

  property Color: TColor;

  

The background color for the control.

  property Constraints: TSizeConstraints;

  

Contains the minimum and maximum Width and Height for the control.

  property DataField: string;

  

Name for the field in the linked dataset used in the control.

  property DataSource: TDataSource;

  

Provides access to the linked dataset for the control.

  property DoubleBuffered: Boolean;

  

When enabled, it reduces flicker when the control is painted.

  property DragCursor: TCursor;

  

The cursor shape shown during a drag operation.

  property DragKind: TDragKind;

  

Indicates the action performed for a drag operation: drag-and-drop or drag-and-dock.

  property DragMode: TDragMode;

  

Determines how a drag operation is started for the control.

  property Enabled: Boolean;

  

Determines whether the control responds to mouse or keyboard input.

  property Font: TFont;

  

The font to be used for text display in this control.

  property KeyField: string; [rw]

  

Field name in the lookup dataset with the value for the control.

  property ListField: string; [rw]

  

Field name with the descriptive value displayed in the listbox.

  property ListFieldIndex: Integer; [rw]

  

Ordinal position of the field in the lookup dataset with the descriptive value displayed in the control.

  property ListSource: TDataSource; [rw]

  

Datasource with the lookup dataset for the control.

  property LookupCache: Boolean; [rw]

  

Indicates if caching is enabled for fields in the lookup dataset.

  property NullValueKey: TShortCut; [rw]

  

Keyboard shortcut used to assign the empty key value to the control.

  property EmptyValue: string; [rw]

  

Value used as the empty field value in the DataField for the control.

  property DisplayEmpty: string; [rw]

  

Descriptive text displayed for the EmptyValue in the control.

  property OnClick: TNotifyEvent;

  

Notification handler for mouse clicks.

  property OnContextPopup: TContextPopupEvent;

  

Invoked when a context-sensitive pop-up menu is requested.

  property OnDblClick: TNotifyEvent;

  

Event handler signalled when a mouse double click occurs in the control.

  property OnDragDrop: TDragDropEvent;

  

Event handler signalled when an object is dropped onto the control.

  property OnDragOver: TDragOverEvent;

  

Event handler signalled when a control is dragged over the control instance.

  property OnEditingDone: TNotifyEvent;

  

Event handler signalled when editing is completed for the control.

  property OnEndDrag: TEndDragEvent;

  

Event handler signalled for the end of a drag-drop operation.

  property OnEnter: TNotifyEvent;

  

Event handler signalled when the control receives focus.

  property OnExit: TNotifyEvent;

  

Event handler signalled when the control loses focus.

  property OnKeyPress: TKeyPressEvent;

  

Event handler signalled for character data entered by the user.

  property OnKeyDown: TKeyEvent;

  

Event handler signalled for key down keyboard events.

  property OnKeyUp: TKeyEvent;

  

Event handler signalled when a key up event has occurred for the control.

  property OnMouseDown: TMouseEvent;

  

Event handler signalled when a mouse down event is handled for the control.

  property OnMouseEnter: TNotifyEvent;

  

Event handler signalled when the mouse pointer has entered the control.

  property OnMouseLeave: TNotifyEvent;

  

Event handler signalled when the mouse pointer has left the control.

  property OnMouseMove: TMouseMoveEvent;

  

Event handler signalled when the mouse pointer is moved in the control.

  property OnMouseUp: TMouseEvent;

  

Event handler signalled when a mouse up event is handled for the control.

  property OnMouseWheel: TMouseWheelEvent;

  

Event handler for mouse wheel turned.

  property OnMouseWheelDown: TMouseWheelUpDownEvent;

  

Event handler signalled for a downward movement of the mouse wheel.

  property OnMouseWheelUp: TMouseWheelUpDownEvent;

  

Event handler signalled for an upward movement of the mouse wheel.

  property OnResize: TNotifyEvent;

  

Notification handler for a resize of the control.

  property OnStartDrag: TStartDragEvent;

  

Event handler signalled for the start of a dragging operation.

  property OnUTF8KeyPress: TUTF8KeyPressEvent;

  

Handler for a character entered by the user.

  property Options: TListBoxOptions;

  

Contains options enabled for the list box control.

  property ParentBiDiMode: Boolean;

  

Indicates whether the BiDiMode settings in the Parent control are used.

  property ParentDoubleBuffered: Boolean;

  

Value for the DoubleBuffered property in a Parent control.

  property ParentShowHint: Boolean;

  

If True, the value of ShowHint for the control will be the same as the one from the Parent. Default is True.

  property PopupMenu: TPopupMenu;

  

A context-sensitive menu that pops up when the right mouse button is clicked over this control.

  property ReadOnly: Boolean;

  

Indicates if the linked dataset for the control cannot be modified.

  property ScrollListDataset: Boolean; [rw]

  

Indicates if the look-up data set is scrolled for a new value in the control.

  property ShowHint: Boolean;

  

Enables Hint display for the control.

  property Sorted: Boolean;

  

Determines whether the list entries are sorted in alphanumeric order.

  property TabOrder: TTabOrder;

  

Indicates the navigation order for the control when the user presses the Tab or Shift+Tab key.

  property TabStop: Boolean;

  

Allows the user to navigate to / from the control by pressing the Tab or Shift+Tab keys.

  property TopIndex: Integer;

  

Index of the first visible (or top-most) item.

  property Visible: Boolean;

  

Allows the control, and all of its children, to be displayed or hidden.

end;

Inheritance

TDBLookupListBox

  

Implements a data-aware listbox control with database lookup capabilities.

|

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,IUnknown,IInterfaceComponentReference

|

TPersistent,IFPObserved

|

TObject

Description

TDBLookupListBox is a TCustomDBListBox descendant which implements a data-aware listbox with database lookup capabilities.

TDBLookupListBox allows selection of a value from a list of items, and stores the value to a field in a linked dataset. The database lookup feature allows a separate dataset to be used which contains the values for the items available in the control. Individual fields can be specified for both the stored value and the the associated display value. Internally, it uses a TDBLookup component to enable the database lookup feature.

In addition, the control can be used in an unbound mode where either the DataSource or the DataField is not defined for the control. This allows the lookup dataset to synchronized when the current selection in the control is changed, but prevents the selected value from being stored in the linked dataset.

Use ListSource to provide access to the lookup dataset used in the control. Use ListField or ListFieldIndex to specify the field name or ordinal position in the lookup dataset displayed in the listbox. Use KeyField to specify the field name in the lookup dataset with the value stored in the DataField for the control. Use KeyValue to read or write the value for the KeyField in the lookup dataset.

See also

TDBLookupListBox.IsUnbound

  

Indicates if the control is being used in the "unbound" mode.

TDBLookupListBox.DataSource

  

Provides access to the linked dataset for the control.

TDBLookupListBox.DataField

  

Name for the field in the linked dataset used in the control.

TDBLookupListBox.ListSource

  

Datasource with the lookup dataset for the control.

TDBLookupListBox.ListField

  

Field name with the descriptive value displayed in the listbox.

TDBLookupListBox.ListFieldIndex

  

Ordinal position of the field in the lookup dataset with the descriptive value displayed in the control.

TDBLookupListBox.KeyField

  

Field name in the lookup dataset with the value for the control.

TDBLookupListBox.KeyValue

  

Accesses the value for the KeyField in the lookup dataset.

TDBLookup

  

TDBLookup - used as source of data by TDBLookupListBox or TDBLookupComboBox, to find data from a lookup table.


Version 3.2 Generated 2024-02-25 Home