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

TDBComboBox

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

TDBComboBox - a data-aware version of TComboBox to allow selection of a value from a list of entries into a database field

Declaration

Source position: dbctrls.pp line 483

type TDBComboBox = class(TCustomComboBox)

protected

  procedure DataChange(); virtual;

  

  procedure ActiveChange();

  procedure EditingChange(); virtual;

  

  procedure Notification(); override;

  

  procedure Change; override;

  procedure UpdateData(); virtual;

  

  procedure FocusRequest(); virtual;

  

  procedure Loaded; override;

  

  procedure UpdateText;

public

  constructor Create(); override;

  

Create a new instance of the Window Control

  destructor Destroy; override;

  

Destroy this instance of the Window Control, and return the resources used

  procedure EditingDone; override;

  

  property Field: TField; [r]

  

The field in the dataset to which this control is attached

  property Text;

  

Text - the string appearing in the main box. If an item on the drop-down list is selected, it replaces the contents of Text

  property ItemIndex;

  

Index - the number of the currently selected item (starting at zero)

published

  property Anchors;

  

The set of anchor definitions for this control

  property ArrowKeysTraverseList;

  

ArrowKeysTraverseList - enables the operator to use the keyboard Arrow keys to move through the list as an alternative to using the mouse

  property AutoDropDown;

  

AutoDropDown - if True, the drop-down list appears as soon as the cursor moves over the text box

  property AutoSize;

  property BorderSpacing;

  

Determines the border spacing for this control

  property Color;

  

Determine the colour for the current control

  property Ctl3D;

  

  property DataField: String; [rw]

  

The name (as a string) of the Feild whose data are to be linked to the ComboBox

  property DataSource: TDataSource; [rw]

  

The DataSet whose Field data are to be linked to the ComboBox

  property DragCursor;

  

DragCursor - the style of cursor to be used during the Drag process

  property DragMode;

  

DragMode - whether manual or automatic

  property DropDownCount;

  

DropDownCount - number of entries in the drop-down list

  property Enabled;

  

Whether the control is Enabled. If not, it usually appears 'greyed-out'

  property Font;

  

The Font to be used for text in this control

  property ItemHeight;

  

ItemHeight - the height of the current item in the drop-down list

  property Items;

  

Items - an array of strings that holds the entries of the drop-down list

  property ItemWidth;

  

ItemWidth - the width of the current item in the drop-down list

  property MaxLength;

  

MaxLength - the maximum allowed length of a string

  property OnChange;

  

OnChange - event handler for any change in properties of the combo box

  property OnChangeBounds;

  

Event handler for a change in bounds of the control

  property OnClick;

  

Event Handler for mouse click

  property OnCloseUp;

  

OnCloseUp - event handler for when the drop-down box is closed up again

  property OnDblClick;

  

Event Handle for mouse double-click

  property OnDragDrop;

  

Event handler for the Drag-Drop manoeuvre

  property OnDragOver;

  

Event handler for the case when a control is dragged over another control

  property OnDrawItem;

  

OnDrawItem - event handler for when an entry is written to the Items list

  property OnDropDown;

  

OnDropDown - event handler for when the drop-down list appears

  property OnEditingDone;

  

Event handler when editing is done

  property OnEndDrag;

  

Event handler for the end of a dragging process

  property OnEnter;

  

OnEnter - event handler for when the mouse enters the control, and the control receives focus

  property OnExit;

  

OnExit - event handler for when the mouse leaves the control and it loses focus

  property OnKeyDown;

  

OnKeyDown - event handler for instance when key is down while control has focus

  property OnKeyPress;

  

OnKeyPress - event controller for a key being pressed while the control has focus

  property OnKeyUp;

  

OnKeyUp - event handler for instance when a key is up (not pressed) while the control has focus

  property OnMouseDown;

  

Event handler for when a mouse button is pressed down

  property OnMouseMove;

  

Event handler for mouse movement within the current control

  property OnMouseUp;

  

Event handler for when the mouse button is released, ie "up"

  property OnSelect;

  

Event Handler for selection of an item in the ComboBox

  property OnStartDrag;

  

Event handler for start of dragging process

  property OnUTF8KeyPress;

  property ParentCtl3D;

  

  property ParentColor;

  

ParentColor - should the control have the same colour as the parent? Default is true

  property ParentFont;

  

ParentFont - should the control use the same font as the parent? Default is true

  property ParentShowHint;

  

ParentShowHint - does the control adopt the same hinting behaviour as its parent? Default is true

  property ReadOnly: Boolean; [rw]

  

ReadOnly - if True, data can only be read, not written or modified

  property ShowHint;

  

Flag to determine: Is hint to be displayed for this control?

  property Sorted;

  

Sorted - whether the entries in the drop-down list have been sorted

  property Style;

  

Style: may be Simple, a single-line Drop-Down or a Drop-Down list, or some version drawn by the Owner

  property TabOrder;

  

The place this control occupies in the list of tabs

  property TabStop;

  

TabStop - determines if the user can tab to a control.

  property Visible;

  

Visible - can the control be seen?

end;

Inheritance

TDBComboBox

  

TDBComboBox - a data-aware version of TComboBox to allow selection of a value from a list of entries into a database field

|

TCustomComboBox

?

TObject

Description

TDBComboBox has properties similar to TComboBox and TCustomComboBox. It consists of an Edit Box which is th eData-aware part of the component, and a drop-down list box.

In a typical application a user would be presented with the drop-down list, would make a selection and then this would appear in the edit box and become the data value for that cell in the database.

So for example a list of countries might be presented, and the selected value from the list would be used to populate the appropriate field ('Country') in that record of the database.

See also

HowToUseDataAwareControls

  

HowToUseDataAwareControls - Hints for accessing databases