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

# TDBCheckBox

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

TDBCheckBox - a data-aware checkbox for use with logical fields in a database

## Declaration

Source position: dbctrls.pp line 546

`type TDBCheckBox = class(TCustomCheckBox)`
`protected`
`function GetFieldCheckState; virtual;` |  | GetFieldCheckState - returns the checkbox state for the current field
`procedure DataChange(); virtual;` |  | DataChange - uses GetFieldCheckState to update the State
`procedure DoOnChange; override;`
`procedure UpdateData(); virtual;` |  | UpdateData - examines the State to see whether it has changed
`procedure FocusRequest(); virtual;` |  | FocusRequest - a request has been received, so Sets Focus
`procedure Notification(); override;` |  |
`procedure Loaded; override;` |  |
`public`
`constructor Create(); override;` |  | Create - constructor for TDBCheckBox: calls inherited Create, forms logical connections for checked and unchecked, sets initial style and state, forms datalinks and actions
`destructor Destroy; override;` |  | Destroy - destructor for TDBCheckBox: frees links and calls inherited Destroy
`procedure EditingDone; override;` |  | EditingDone - if the datalink is in an Editing state, updates the data through the link then calls inherited EditingDone
`property Checked;` |  | Checked - whether this button has been checked, which signifies selection
`property Field: TField; [r]` |  | The Field in the DataSet with which the box is to be associated
`property State;` |  | Indicates whether the check box is checked (selected), unchecked (deselected) or grayed.
`published`
`property AllowGrayed;` |  | Determines whether the check box can be in a "grayed" state.
`property Align;`
`property Anchors;` |  | The set of anchor definitions for this control
`property AutoSize;` |  | Whether auto-size is to be used
`property BorderSpacing;` |  | Determines the border spacing for this control
`property Caption;` |  | Caption - the text-string appearing on the Control, usually used to identify its function
`property Color;` |  | Determine the colour for the current control
`property DataField: String; [rw]` |  | The name (as a string) of the field with which the checkbox is to be associated
`property DataSource: TDataSource; [rw]` |  | The DataSource containing the Field that is to be associated with this checkbox
`property DragCursor;` |  | DragCursor - the style of cursor to be used during the Drag process
`property DragKind;` |  | DragKind - what sort of dragging? Drag or Dock
`property DragMode;` |  | DragMode - whether manual or automatic
`property Enabled;` |  | Whether the control is Enabled. If not, it usually appears 'greyed-out'
`property Font;`
`property Hint;` |  | Hint - a small informative pop-up box that appears when the mouse 'hovers' over a control
`property OnChange;` |  | OnChange - event handler for any change in properties of the control
`property OnClick;` |  | Event Handler for mouse 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 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 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 OnStartDrag;` |  | Event handler for start of dragging process
`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 PopupMenu;` |  | PopupMenu - a context-sensitive menu that pops up when the right mouse button is clicked over this control
`property ReadOnly: Boolean; [rw]` |  | ReadOnly - if True, data may be read but not written or modified (doesn't make much sense for a check-box unless the box is NOT Enabled!)
`property ShowHint;` |  | Flag to determine: Is hint to be displayed for this control?
`property TabOrder;` |  | The place this control occupies in the list of tabs
`property TabStop;` |  | Is the control in the sequence of controls accessed by successive presses of the Tab key?
`property ValueChecked: String; [rw]` |  | ValueChecked - the box for the value has been checked
`property ValueUnchecked: String; [rw]` |  | ValueUnchecked -the box for the value is unchecked
`property Visible;` |  | Visible - can the control be seen?
`end;`

## Inheritance

`TDBCheckBox` |  | TDBCheckBox - a data-aware checkbox for use with logical fields in a database
`TCustomCheckBox`
?
`TObject`

## See also

HowToUseDataAwareControls |  | HowToUseDataAwareControls - Hints for accessing databases

The latest version of this document can be found at lazarus-ccr.sourceforge.net.