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

# TDBCalendar

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

TDBCalendar - a data-aware version of TCalendar, for selecting a date to store in a database field.

## Declaration

Source position: dbctrls.pp line 1262

`type TDBCalendar = class(TCalendar)`
`protected`
`procedure Notification(); override;` |  | Handles the notification when a component on the control is added or removed.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`procedure EditingDone; override;` |  | Performs actions needed when the user has finished editing.
`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.
`property Field: TField; [r]` |  | Provides access to the field definition for the data-aware control.
`published`
`property BorderSpacing: TControlBorderSpacing;` |  | Determines the inner and outer border spacing for this control.
`property Constraints: TSizeConstraints;` |  | Contains the minimum and maximum Width and Height for the control.
`property DataField: string; [rw]` |  | Contains the name of the field with the value for the control.
`property DataSource: TDataSource; [rw]` |  | Provides access to the dataset with content for the control.
`property Date: string; [ws]` |  | Date value for the control as a String type.
`property ReadOnly: Boolean; [rw]` |  | Indicates if the control cannot modify the field in the linked dataset.
`property DisplaySettings: TDisplaySettings; [s]` |  | DisplaySettings contains options which control the appearance or behavior for the calendar 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 DragMode: TDragMode;` |  | Determines how a drag operation is started for the control.
`property ParentDoubleBuffered: Boolean;` |  | Value for the DoubleBuffered property in a Parent control.
`property Visible: Boolean;` |  | Allows the control, and all of its children, to be displayed or hidden.
`property OnClick: TNotifyEvent;` |  | Notification handler for mouse clicks.
`property OnContextPopup: TContextPopupEvent;` |  | Invoked when a context-sensitive pop-up menu is requested.
`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 OnEndDrag: TEndDragEvent;` |  | Event handler signalled for the end of a drag-drop operation.
`property OnMouseMove: TMouseMoveEvent;` |  | Event handler signalled when the mouse pointer is moved in the control.
`property OnMouseDown: TMouseEvent;` |  | Event handler signalled when a mouse down event is handled for the control.
`property OnDayChanged: TNotifyEvent;` |  | Event handler signalled when the day number in DateTime has been changed using the calendar control.
`property OnMonthChanged: TNotifyEvent;` |  | Event handler signalled when the month number in DateTime has been changed using the calendar control.
`property OnStartDrag: TStartDragEvent;` |  | Event handler signalled for the start of a dragging operation.
`property OnYearChanged: TNotifyEvent;` |  | Event handler signalled when the year number in DateTime has been changed using the calendar control.
`end;`

## Inheritance

`TDBCalendar` |  | TDBCalendar - a data-aware version of TCalendar, for selecting a date to store in a database field.
`TCalendar` |  | TCalendar allows selection of a date from a calendar display.
`TCustomCalendar` |  | Implements the base class for TCalendar.
`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

TDBCalendar is a TCalendar descendant which implements a data-aware calendar control used to select a date and store its value in a database field. TDBCalendar, like its ancestor, displays a calendar which can be used to navigate through years, months, and days to select the Date value for the control. When Date has been assigned, it is stored in the field identified by the name in DataField.

Use Field to access the definition and metadata for the field where the Date value is stored.

Use DataSource to assign the component with the dataset where the Date value is stored.

Use DisplaySettings to control the visual appearance and content displayed on the calendar control.

Use the OnYearChanged event to perform action required when the navigation arrows in the calendar are used to change the year in the Date value.

Internally, a TFieldDataLink class instance is used to maintain the association between the control, the datasource, and the field. In addition, support for using standard actions is provided in the ExecuteAction and UpdateAction methods.

Remark: |

## See also

TCalendar |  | TCalendar allows selection of a date from a calendar display.
How To Use Data-aware Controls |  | HowToUseDataAwareControls - Hints for accessing databases.